Technically, yes (the ActiveRecord class created by the model command), but i didnt touch it. I just created a new vhost (yii.dev) on my webserver and ran the following commands:
[tt]# yicc webapp htdocs[/tt]
[tt]# vi htdocs/protected/config/main.php[/tt] (configured my mysql db here with proper dsn and credentials)
[tt]# yiic shell htdocs/index.php[/tt]
[tt]>> model Pages[/tt] (Pages is an existing innodb table with 44 records in it)
[tt]>> crud Pages[/tt]
opened http://yii.dev/index.php?r=pages with firefox and then, at the end of the page (where it tries to create the pager for the table) received the following message:
[tt]Fatal error: Call to undefined method Pages::getPageCount() in /var/www/localhost/library/yii/framework/web/widgets/pagers/CBasePager.php on line 97[/tt]
That's because of the naming conflict between your Pages and the $pages variable in the generated code. Check actionList in the controller to verify this.
I suggest you use a different AR class name (your AR class name doesn't need to be the same as the table name.)
So i cant have a url like http://domain.tld/pages/ where a customer, e.g. a book author, might want to publish a few excerpts from a new book or a design company that wants to show a few of the web pages they made?
I didnt create any. Like i already wrote in my second post in this thread, i just created the crud stuff via yiic command and tried to access the automatically rendered page. I see the page, with table contents and everything and where it tries to render the pager for the table it produces said message.
Note, yiic crud is not meant to completely replace your programming task. Its main purpose is to give you a good start. You still need to modify the code if needed.
No? Did you run "crud Pages"? Then it should create PagesController.php under /protected/controllers for you. Otherwise how can you access /index.php?r=pages ?
$pages was used in the foreach loop, and it is then passed to the pager at the end. This is not right, because $pages is supposed to be passed from the controller. That's the name conflict I mentioned earlier.
So to solve this, just rename the temp variable $pages in foreach to something else.
Ah i see. Thats an easy to fix once and for all: In framework/cli/views/shell/crud/list.php just replace all occurances of [tt]${$modelVar}[/tt] with [tt]$_{$modelVar}[/tt].