You don't. That should be in the model. From the view, you should look
into requestAction() to call a method in your controller. But before
you do that you should consider putting the logic in the controller to
begin with, and not in the view.
On Mon, Aug 6, 2012 at 1:29 PM, mohit kumar <mohitkr05@gmail.com> wrote:
> How to use them in view template?
>
>
> With Best Regards,
> Mohit Kumar
> +91-9582894570
>
>
>
> On Mon, Aug 6, 2012 at 10:43 PM, Vinicius Dusso <vinidusso@gmail.com> wrote:
>>
>> Hi Mohit,
>>
>> You can use the 'query' method:
>>
>> $this->YourModel->query('SELECT * FROM table');
>>
>> Take a look in this tutorial:
>> http://book.cakephp.org/1.3/view/1027/query
>>
>> []'s
>>
>> Vinicius
>>
>> Em segunda-feira, 6 de agosto de 2012 13h06min53s UTC-3, mohit escreveu:
>>>
>>> Hi Folks,
>>> What is the best way to have custom queries from the database. I need to
>>> query from one of the pages.
>>>
>>> With Best Regards,
>>> Mohit Kumar
>>> +91-9582894570
>>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscribe@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Monday, August 6, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment