Hi, I'm trying something different here by not following the
conventions because of my very complex requirements.
Here's how I want it to work:
app/controllers/publisher_controller.php
-----------------------------------------------------------------------
class PublisherController extends AppController
{
var $name = 'Publisher';
var $uses = array('Post');
function index() {
$this->set('data',$this->Post->findAll());
}
}
-----------------------------------------------------------------------
Note that I havent used a plural name because I want the links to show
up like /publisher/<function>/<param> and NOT like
/publisher*s*/<function>/<param>
Now the model /app/models/post.php
-----------------------------------------------------------------------
Class Post {
var $name = 'Post';
}
-----------------------------------------------------------------------
The view file is stored in /app/views/publisher/index.thtml
-----------------------------------------------------------------------
<div id="content">
<div class="title"><? echo $data['Post']['title']; ?></div>
<div class="body"><? echo $data['Post']['body']; ?></div>
</div>
-----------------------------------------------------------------------
but this unconventional system isnt working for me. I am getting this
error:
Fatal error: Call to undefined method Post::findAll() in
C:\www\cake\app\controllers\publisher_controller.php on line 29
I know I can fix the problem by changing the controller file name to
PostsController.php and class name to PostsController but that's not
how I want it to be.
Any suggestions how I might get it to work?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---