Is there any way to create a view for custom tag in Phalcon so I can just pass the parameters to be rendered?
class MenuModule extends \Phalcon\Tag {
public static function initialize($param) {
return $param;
}
}
In my view I can call
echo MenuModule::initialize('Home Page');
What I want to do is to pass array like:
$menu = array('Home','About','Contact');
echo MenuModule::initialize($menu);
And then in Tag Helper to call a subview to render that array instead of something like this:
class MenuModule extends \Phalcon\Tag {
public static function initialize($param) {
$menu = '<ul>';
foreach($param as $p) {
$menu .= '<li>' . $p . '</li>';
}
$menu .= '</ul>';
return $menu;
}
}
This is not that complex, but I want to use views instead of generating HTML inside PHP because of a larger HTML files.
How can I do this please?