Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement form_ methods like in Symfony #107

Open
freezy-sk opened this issue May 10, 2018 · 0 comments
Open

Implement form_ methods like in Symfony #107

freezy-sk opened this issue May 10, 2018 · 0 comments
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement

Comments

@freezy-sk
Copy link

Current usage of ActiveForm is really complicated.
It requires combination of {{ use() }}, {% set form %} and |raw.

{{ use('yii/widgets/ActiveForm') }}
{% set form = active_form_begin({
    'id' : 'login-form',
    'options' : {'class' : 'form-horizontal'},
}) %}
    {{ form.field(model, 'username') | raw }}
    {{ form.field(model, 'password').passwordInput() | raw }}

    <div class="form-group">
        <input type="submit" value="Login" class="btn btn-primary" />
    </div>
{{ active_form_end() }}

It can be simplified like Symfony's form_ functions
https://symfony.com/doc/current/reference/forms/twig_reference.html

@samdark samdark added the type:enhancement Enhancement label May 10, 2018
@samdark samdark added the status:ready for adoption Feel free to implement this issue. label Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants