Tuesday, August 23, 2011

Re: Plugin Elements

if you are on cake <= 2.0.0-dev than you use like you say, if you are on cake >= 2.0.0-alpha, then, do this

$this->element('elementname', array('variablenameforelement' => 'value', 'second' => 'value2, array('plugin' => 'plugin_name'));

so first parameter is element name
second are vars for element
third are element vars (cache, plugin, etc)

--
Lep pozdrav, Tilen Majerle



2011/8/23 Jeremy Rottman <rottmanj@gmail.com>
I am working on a new plugin and I have a few questions about using
elements with plugins.

To give a basic example of my plugin, I have 3 different controllers
in my plugin: ControllerA, ControllerB, ControllerC. The elements I am
creating for each controller is simply a quick view of the data.

In the plugin controller I have a method/view called landing, from
with in this landing.ctp file I need to call in the plugin elements.

So my first question, is this best practice with using plugins?
My second question, how would I do this? I have read the overview of
elements with plugins but it doesn't explain much.
My assumption is something like this:
<?php echo $this->element('element_name', array('plugin' =>
'pluginname')); ?>

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

No comments: