I am new to CakePHP and would like to know as how these lines work in Cake
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
Where do the meta tag, css and javascript files that are being fetched come from?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$this->fetch('something');According to the cakephp book , the
fetchfunction is looking forblocksnamedsomethingandechothem.In your example, as far as I understand , it looks for something like that in your view:
and treat it as a block.
so
$this->fetch('script')will get all thehtml->script(....)and print them.Read more : http://book.cakephp.org/2.0/en/views.html