Monday, October 17, 2011

rendering elements from helpers in Cakephp2

Hello,

in 1.3, I could do this:

$View =& ClassRegistry::getObject('view');

// boring code

$str = str_replace($tagMatches[0][$i], $View->element($element,
$options), $str);

and i could ouptut elements from my filter helper. For short codes
and stuff.

I think View has been removed from the ClassRegistry for 2.0. How can
i do this now?

I tried this: $View = new View($this->controller);

but all the helpers except for core ones get forgotten, and then the
fatal errors being.

thanks for any help

will

--
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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate