您的位置:首页 > 移动开发

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

2012-07-26 16:39 525 查看
( ! ) 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; 改为[b]$this->view->res=$res; 它就像个session 赋与其名即可

[/b]

//控制器中的一个函数

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');

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: