( ! ) Warning: Invalid argument supplied for foreach() in F:\xampp\htdocs\zendfrm\application\views\


( ! ) Warning: Invalid argument supplied for foreach() in F:\xampp\htdocs\zendfrm\application\views\scripts\index\index.phtml on line 46
Call Stack
#TimeMemoryFunctionLocation
10.0025340224{main}( )..\index.php:0
20.05123626240Zend_Application->run( )..\index.php:26
30.05123626240Zend_Application_Bootstrap_Bootstrap->run( ) ..\Application.php:366
40.05143626296Zend_Controller_Front->dispatch( ???, ??? ) ..\Bootstrap.php:97
50.06894936608Zend_Controller_Dispatcher_Standard->dispatch( object(Zend_Controller_Request_Http)[17], object(Zend_Controller_Response_Http)[18] ) ..\Front.php:954
60.08505283280Zend_Controller_Action->dispatch( string(11) ) ..\Standard.php:295
70.08535286600IndexController->indexAction( ) ..\Action.php:516
80.10335725992Zend_Controller_Action->render( string(5), ???, ??? ) ..\IndexController.php:29
90.10375726216Zend_Controller_Action_Helper_ViewRenderer->render( string(5), null, bool ) ..\Action.php:212
100.10605726352Zend_Controller_Action_Helper_ViewRenderer->renderScript( string(17), null ) ..\ViewRenderer.php:921
110.10615726352Zend_View_Abstract->render( string(17) ) ..\ViewRenderer.php:900
120.10725767528Zend_View->_run( string(67) ) ..\Abstract.php:888
130.10775771416include( 'F:\xampp\htdocs\zendfrm\application\views\scripts\index\index.phtml' )..\View.php:108

( ! ) Notice: Array to string conversion in F:\xampp\htdocs\zendfrm\application\controllers\IndexController.php on line 24

Call Stack

#

Time

Memory

Function

Location

1

0.0025

340224

{main}( )

..\index.php:0

2

0.0512

3626240

Zend_Application->run( )

..\index.php:26

3

0.0512

3626240

Zend_Application_Bootstrap_Bootstrap->run( )

..\Application.php:366

4

0.0514

3626296

Zend_Controller_Front->dispatch( ???, ??? )

..\Bootstrap.php:97

5

0.0689

4936608

Zend_Controller_Dispatcher_Standard->dispatch( object(Zend_Controller_Request_Http)[17], object(Zend_Controller_Response_Http)[18] )

..\Front.php:954

6

0.0850

5283280

Zend_Controller_Action->dispatch( string(11) )

..\Standard.php:295

7

0.0853

5286600

IndexController->indexAction( )

..\Action.php:516

 

 

将控制器中的 $this->view->$res=$res;  改为$this->view->res=$res;  它就像个session  赋与其名即可

  //控制器中的一个函数
    public function indexAction()
    {
        // action body
        file_put_contents("d:/mylog.txt", __FILE__.date('y-m-d h:i:s')."index..\r\n",FILE_APPEND);
        //如果什么都没有些,相当于有以下一句话;用view/scripts/index/index.phtml
        $messageModel=new Message();
        $res=$messageModel->fetchAll()->toArray();
        //怎样把控制器获取的数据 array  object  int
        $this->view->res=$res;
       /* echo '<pre>';
        print_r($res);
        echo '</pre>';
        */
        $this->render('index');
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值