1

I'm trying to figure out how to load/set models/classes in Lithium controller. This is my first so serious framework & I like it very much, but I dont know a lot about them. Have used only simple one.

The problem what I have is: I'm trying to figure out how to display different controllers/models in one view/layout (display posts, polls, login box etc in one page). I found a tutorial for cakePHP, so you can see here whats bothering me. I could find answer in Litihum docs. Maybe becouse I just don't know the real key words for that.

http://nuts-and-bolts-of-cakephp.com/tag/cakephp-dashboard/

jonsca
  • 10,218
  • 26
  • 54
  • 62
Mr. Sensitive
  • 685
  • 1
  • 6
  • 16

1 Answers1

2

If you want to display multiple models at once in the same view (like users, latest posts, etc) you can just reference the class:

use chowly\models\Offers;
use chowly\models\Venues;

class OffersController extends \chowly\extensions\action\Controller{
    public function index(){
        $venues = Venues::find('all');
        $offers = Offers::find('all);
    }
}

In lithium, you just need to reference a class and you can use it. (No ClassRegistry)

For a working Lithium application, take a look at https://github.com/masom/Chowly and join the irc channel on irc.freenode.net #li3

Martin Samson
  • 3,970
  • 21
  • 25