Hello everybody,
yesterday I’ve started creating my first web application using Yii. Basically I’ve to do I little work using php and mysql and I’ve decided to use Yii in order to learn a new framework
I’ve just a question because I’ve to show a list of file and I think that using a CListView is an elegant way to do it.
The only problem is that I didn’t figure out how to let this work. On the class reference I used the example just to see how it works:
$dataProvider=new CActiveDataProvider('Post');
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_post', // refers to the partial view named '_post'
'sortableAttributes'=>array(
'title',
'create_time'=>'Post Time',
),
));
I think that Post should be a class of the Model, therefore I used one of mine ("Utente") and then the the partial view I assumed that is the view I used mine that is "Home".
<?php
$dataProvider=new CActiveDataProvider('Utente');
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'home', // refers to the partial view named '_post'
'sortableAttributes'=>array(
'title',
'create_time'=>'Post Time',
),
));
?>
I put this code in the view /webapp/protected/view/site/home.php
But what I get is just a blank page and this php error:
[01-Sep-2011 22:17:02] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 40961 bytes) in /Users/giuliovalente/Documents/QBT/Gemini/framework/web/CBaseController.php on line 117
Does anybody where I did wrong?
Thank in advance for any help.