php - How do I render a view into a variable in ZF2? -
in class file, trying render .phtml file variable , pass html output of .phtml file variable in viewmodel. how do in zf2?
the code have far is, doesn't seem work:
$layout = new viewmodel(); $layout->settemplate('myphtmlfile.phtml'); $layout->setterminal(true); $viewmodel = new viewmodel(); $viewmodel->setvariable('formbody', $layout);
please see answer have provided in following thread:
this same:
- you need phpviewrenderer
- you save output of
render()
function variable - you pass variable view
however doing has pretty use-case that's described within other post. why want this? highly there's better solution you're trying accomplish.
Comments
Post a Comment