MainelyDesign.com Blog

Calling an Element from a Helper

Posted on 02/24/2012 at 02:07 pm by Kevin Wentworth
Viewed 12,298 times | 0 comments

This one caused me more than a little headache,  turned out it was easily solvable.

renderElement() can be used in a helper function.

The following example worked nicely for me.

In this case I am calling and element "order_form.ctp"

 

$theView = ClassRegistry::getObject('view');

echo $this->output($theView->renderElement('order_form'));

Bookmark and Share

Tags for Calling an Element from a Helper

Cakephp | Web Programming | Usage | Tutorial | Example

Comments for this Posting

No comments. Be the first to post a reply.

Sorry, comments are closed for this posting.

Please Email Kevin if you have any questions. Thanks!

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design