I have a CakePHP application that in some moment will show a view with product media (pictures or videos) I want to know if, there is someway to include another view that threat
In the interest of having the information here in case someone stumbles upon this, it is important to note that the solution varies depending on the CakePHP version.
$this->renderElement('display', array('flag' => 'value'));
in your view, and then in /app/views/elements/
you can make a file called display.thtml
, where $flag
will have the value of whatever you pass to it.
$this->element('display', array('flag' => 'value'));
in your view, and then in /app/views/elements/
you can make a file called display.ctp
, where $flag
will have the value of whatever you pass to it.
requestAction()
is also an option, but it can take a heavy toll in performance if done without using cache, since it has to go through all the steps a normal action would.