Re: load 2 models in controller

2014-05-24 Thread Stephen S
You have a few options really. In your controller, if you feel you will use the Teacher model in majority of actions/methods you can add this property: public $uses = array('Teacher'); If you think you will use the Teacher model several times in a single action, you can use the following: $this-

Re: load 2 models in controller

2014-05-24 Thread Andrew Barry
I dont think it should be this complicated. You are just loading a model in a controller and i see many examples of ths but i cant get it to work. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are

RE: load 2 models in controller

2014-05-23 Thread Advantage+
p@googlegroups.com Subject: Re: load 2 models in controller I need to know how this is done . ( My example was just that). I just want to load another tables data in on the same view as another table data (just assume the data is not related). -- Like Us on FaceBook https://www.faceb

Re: load 2 models in controller

2014-05-23 Thread Andrew Barry
I need to know how this is done . ( My example was just that). I just want to load another tables data in on the same view as another table data (just assume the data is not related). -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You

RE: load 2 models in controller

2014-05-23 Thread Advantage+
ke-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Andrew Barry Sent: Saturday, May 24, 2014 3:04 AM To: cake-php@googlegroups.com Subject: load 2 models in controller Hi, In my view I want to display data from 2 tables (maybe not related). I read i do the following to load 2 mode

load 2 models in controller

2014-05-23 Thread Andrew Barry
Hi, In my view I want to display data from 2 tables (maybe not related). I read i do the following to load 2 model in a controller and simply access the other model in the view. I get an error in the view file so this method of loading 2 models in a contrller doesnt work? Undefined index: Teac