php - CakePHP: How to use a view element inside of a controller -


i'm trying figure out how use 1 of view elements inside of controller...

i know, know: "don't that!" (99% of time correct answer)

but think have reason. action handling ajax request returns markup. returned markup list display everywhere else using element. in effort keep code dry, think it's appropriate here.

is possible?

easy:

$view = new view($this, false); $content = $view->element('my-element', $params); 

also:

don't anymore!!!


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -