Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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



7.1k
Accepted
answer

Hi, I success,

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