duanboxue3422 2012-12-06 14:15
浏览 26

如何将PHP代码转换为Zend Framework 2 [重复]

Possible Duplicate:
How to use Zend\Session in zf2?

I begin with ZF2 but I can't continue because I don't understand the official ZF2 documentation.

I run version 2.0.4.

How can I simply translate this PHP code into ZF2?:

include.php

session_start();

index.php

$_SESSION['login'] = 'toto';

otherpage.php

if ( isset($_SESSION['login']) ) echo $_SESSION['login'];//view toto

I tried with Zend\Authentification\Storage\Session and Zend\Session but nothing worked.

  • 写回答

1条回答 默认 最新

  • duannue2455 2012-12-06 14:46
    关注

    Zend is a framework and there is no way to "simply translate" PHP to Zend. Just look at functionality you are trying to achieve, and see if there is classes provided by Zend, that could replicate it.

    You will basically have to completely rewrite the whole thing, because Zend strictly enforces MVC pattern.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?