On the other hand, to answer your question, you can always use:
ClassRegistry::init('ModelName')-find(...)
to read data from a model in a view.
I often use this approach in cached elements, that display things like
yesterdays stats where the read access is needed but only once per
day then
Just be careful with requestAction. If you don't cache properly you
can dramatically slow down your application. Mark Story has some good
tips on requestAction use at his blog (http://mark-story.com/)
On Sep 28, 12:15 pm, John Andersen j.andersen...@gmail.com wrote:
It will not be much more
I don't see it as making the controller fat, really. It's where
this call belongs. I usually think of fat controllers as doing some
of the models' heavy lifting for them.
But in this case, putting the code in your controller is clearly the
right thing to do, by Cake's MVC principles.
Don't
On Sep 25, 10:27 am, John Andersen j.andersen...@gmail.com wrote:
Look into the controllers method requestAction, which allows you to
retrieve the list of clubs in a view!
Enjoy,
John
On Sep 24, 11:59 am, hunny saurabh85maha...@gmail.com wrote:
Hi Guys,
I am new to cakephp. I am
It will not be much more fat, as the only thing each function used by
a requestAction should be doing, is to call the model and return the
models data.
Enjoy,
John
On Sep 28, 12:46 pm, hunny saurabh85maha...@gmail.com wrote:
On Sep 25, 10:27 am, John Andersen j.andersen...@gmail.com wrote:
1.3 will not be implementing object results from models. 1.3 is still
php4 compatible, and is a _minor_ version release. Switching out the
lower levels of how models work is not a minor change. Perhaps you
are thinking of CakePHP 2.x?
-Mark
On Sep 24, 3:25 pm, Jon Bennett jmbenn...@gmail.com
hi Mark
1.3 will not be implementing object results from models. 1.3 is still
php4 compatible, and is a _minor_ version release. Switching out the
lower levels of how models work is not a minor change. Perhaps you
are thinking of CakePHP 2.x?
Ahh, ahem - yes, I was
--
jon bennett
w:
Hi Guys,
I am new to cakephp. I am having the following issue:
I am displaying list of checkbox containing clubs to a login user. The
list of clubs I am passing through the models via controllers in the
traditional way.
Now the logged in user should see his list of clubs automatically
ticked.
Hi,
Basically i am looking for something similar like View Helpers in
Zend. We can access the model data in views using view Helpers. Is
there something similar in cakephp.
Short answer: you can't.
Longer answer: as the current version of cake is both php4 and 5
compatible, it uses arrays
Ever heard of a can of worms :)
(The whole -This is MVC. -No, this is MVC thing can turn nasty at
times.)
Cake allows no direct access to Models from Views. That is how the MVC
pattern has been implemented in Cake even though there are other
interpretations in other Frameworks. If everyone had
Look into the controllers method requestAction, which allows you to
retrieve the list of clubs in a view!
Enjoy,
John
On Sep 24, 11:59 am, hunny saurabh85maha...@gmail.com wrote:
Hi Guys,
I am new to cakephp. I am having the following issue:
I am displaying list of checkbox containing
11 matches
Mail list logo