We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get value element in View when submited

Hi all, I using phalcon 3.x.

<?php
$form = new LandPostForm();
$this->view->form = $form;

Code in LandPostForm();

$post_title = new Text('post_title', [
    'class' => 'form-control',
    'placeholder' => 'Tiêu đề'
]);
$post_title->setLabel('Tiêu đề:');
$this->add($post_title);

How to get value post_title when submited in view file volt template



26.2k
Accepted
answer

Hi, I success,

<pre>
    {{ dump(form.get('post_title').getValue()) }}
</pre>