Warning: Illegal string offset '_imagedir' in /home/cakephpf/public_html/lofiversion/index.php on line 545

Warning: Illegal string offset '_emodir' in /home/cakephpf/public_html/lofiversion/index.php on line 546
CakePHP UnOfficial Community Forum > $content_for_layout or $this->fetch('content');
Help - Search - Member List - Calendar
Full Version: $content_for_layout or $this->fetch('content');
CakePHP UnOfficial Community Forum > Layouts and Design

imac
Hello,

I am working with CakePHP 2.0. The one i downloaded on October.

I am trying to create my default layout and i find out that it doesnt work well following the CookBook steps.

It doesn't recognize $this->fetch() and it shows this error:
Fatal error: Call to undefined method View::fetch() in /Applications/MAMP/htdocs/webnoticias/app/View/Layouts/default.ctp on line 9

This doesn't work:
[PHP]<?php echo $this->fetch('content'); ?>[/PHP]

And only works with:
[PHP]<?php echo $content_for_layout ?>[/PHP]

So... whats the problem guys?
I am completely sure i am using CakePHP 2.0

Why the CookBooks doesnt say it well?
Thanks.
mark_germany
there is a note "New in version 2.1." above it
- and below, as well, of course.
imac
QUOTE (mark_germany @ Jan 10 2012, 10:51 PM)
there is a note "New in version 2.1." above it
- and below, as well, of course.

But... i am using 2.0... where should i look for my answers if in the CookBook 2.0 they talk about 2.1?

I dont want to download the 2.1 now... i just want to know how to do it with 2.0... should i check it on the 1.3 CookBook? Isn't that stupid?

Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.
Lo-Fi 1.1 iDS Beta, Originally written by Matt,
re-written by Shaun Harrison, Layer 04.com, for pre IPB2.0 versions.