phalcon表单添加选项

时间:2016-08-05 20:22:15

标签: php phalcon

我有phalcon表格的问题。我添加了一个表单,但我不能添加像

这样的选项
[
'id' => 'login-form',
'class' => 'form form-x',
'data-form-style' => 'dynamic, rootable, hash',
'data-encrypt' => 'false'
]

我想在phalcon文档中添加所有名为setuserOption的内容,但我无法做到。

 //form add user options 
 $this->setuserOptions(
    [
        'id' => 'login-form',
        'class' => 'form form-x',
        'data-form-style' => 'dynamic, rootable, hash',
        'data-encrypt' => 'false'
    ]
 );

//my form
$this->setuserOptions([
    'id' => 'login-form',
    'class' => 'form form-x',
    'data-form-style' => 'dynamic, rootable, hash',
    'data-encrypt' => 'false'
]);

}

//this is volt ( form.options is written by me .how can i use this options )
{{ content() }}

{{ form('login/login', form.options) }}
    <div class="form-group">
        {{ form.label('username') }}
        {{ form.render('username', ['class': 'form-control']) }}
    </div>
    <div class="form-group">
        {{ form.label('password') }}
        {{ form.render('password', ['class': 'form-control']) }}
    </div>
    <div class="form-group">
        {{ form.render('submit', ['class': 'btn btn-primary btn-large']) }}
    </div>
</form>

1 个答案:

答案 0 :(得分:1)

如果查看{{3}},可以在表单标记中添加属性,如下所示:

<?php
 echo Phalcon\Tag::form(array("posts/save", "method" => "post"));

或使用Volt语法:

<?php
 {{ form("posts/save", "method": "post") }}