N
N
Nikolai Gromov2017-09-19 10:30:40
Twig
Nikolai Gromov, 2017-09-19 10:30:40

Is the conversion done correctly in twig?

Hello. I have a view file like this
login.phtml

<?php
$socialSignIn = true;
foreach ($this->options->getEnabledProviders() as $provider) {
    if ($socialSignIn) {
        echo '<h1>Social Sign In</h1>';
        $socialSignIn = false;
    }
    echo '<dd>' . $this->socialSignInButton($provider, $this->redirect) . '</dd>';
}
if ($this->options->getSocialLoginOnly() == false) {
    echo $this->zfcUserLogin;
}

Since I use the twig template engine, I remade this file for it
{% block forkScnSocialAuthUserLogin %}    
    {% set socialSignIn = 'true' %}
    {% for provider in options.getEnabledProviders() %}
        {% if socialSignIn %}
            <h1>Social Sign In</h1>
            {% set socialSignIn = 'false' %}
        {% endif %}    
        <dd>{{ socialSignInButton( provider|raw, redirect ) }}</dd>                
    {% endfor %}
    {% if options.getSocialLoginOnly() == 'false' %}
        {{ zfcUserLogin }}
    {% endif %}
{% endblock forkScnSocialAuthUserLogin %}

but for some reason it doesn't work for me.
Did I convert the file correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question