Render view as string inside a helper
Permalink
I have extended the concrete5 form helper.
Its a form builder that can build complete form blocks at once.
At this moment I am building up these blocks in functions so my code is like:
$string = "<div>" . $form->text() . "</div>" etc.
Now some blocks need a lot of elements so the way I use above isn't really a clean way, specially when we decide to make adjustments in the templates.
Is it possible to use view files for this in my helpers ?
-> Load a view file and return that in to a string.
If so, how would I do this
Or any other way I can build large blocks with elements in my helpers ?
Its a form builder that can build complete form blocks at once.
At this moment I am building up these blocks in functions so my code is like:
$string = "<div>" . $form->text() . "</div>" etc.
Now some blocks need a lot of elements so the way I use above isn't really a clean way, specially when we decide to make adjustments in the templates.
Is it possible to use view files for this in my helpers ?
-> Load a view file and return that in to a string.
If so, how would I do this
Or any other way I can build large blocks with elements in my helpers ?