eDevil,

I think your Post class should extends AppModel or some other Model Class.

Regards,

--
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net

On 8/24/06, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote:


On Aug 24, 2006, at 12:44 PM, eDevil wrote:

>
> 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>

You might try using routes to play with URLs rather than class names.

>
>
> 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

What does your PublisherController look like? What's on line 29?

-- John







--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to