storing variable in twig? -
i starting play twig, noob @ it. sorry if question sounds utterly stupid, well.. looked bit everywhere, , didn't find anything.
so, how can store string input user variable in twig?
like in template have:
<input type="text" name="name"/>
what shall store "value" of input variable? here direct way it?
or shall different?
if so, should for?
you need pass variable controller template,
<?php $twig->render('template.twig', [ 'name' => isset($_post['name']) ? $_post['name'] : '', ]);
template.twig
<input type="text" name="name" value="{{ name }}" />
Comments
Post a Comment