Hello,
> Actually I have 4 tables in my database :
>
> 1-comments
> 2-posts
> 3-categories
> 4-work
>
> And i have a lonely page : default.php (my web site is juste 1 page ).
> which is located in my webSite Root.
Any reason not to follow the Cake MVC pattern / file structure?
> So i want to get all the tables records in my page(default.php) ,all
> my models r working ,my controllers as well .
>
> The problem is i want to show all my tables records in the same page ,
> how can i do that without being forced to use every view of every model
> (table) .
If I understand your goal right, you can always instantinate/import
models (using App::import('model', ...)) in any controller action and
just pass results to the views. Even better would be to add all 4
model names to the controller var $uses array, then you can just use:
$this->Comment->find
$this->Post->find
$this->Categories->find
etc.
Of course in case of relationships you can usually do it with even
less code.
Regards,
Piotr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---