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.

Volt macro bug?

I can't figure out why this is happening. It seems by using a macro I am only getting the first character in each variable. I am using 2.1.0r built yesterday.

https://github.com/phalcon/cphalcon/issues/11857

    {%- macro panel(title, body) %}
    <div class="col-md-3">
        <div class="panel panel-default center">
            <div class="panel-heading"><strong>{{ title }}</strong></div>
            <div class="panel-body">
                {{ body }}
            </div>
        </div>
    </div>
    {%- endmacro %}

    <h2 class="sub-header">Edit Account</h2>
    <div class="table-responsive">
        <div class="panel panel-primary">
            <div class="panel-heading">{{ account.email }}</div>
            <div class="panel-body">
                {{ panel("ID", account.id) }}
                {{ panel("E-Mail", account.email) }}
                {{ panel("Last Login", account.lastlogin) }}
                {{ panel("Created IP", account.created_ip) }}
                {{ panel("Role", account.role) }}
            </div>
        </div>
    </div>

is outputting

    <h2 class="sub-header">Edit Account</h2>
    <div class="table-responsive">
       <div class="panel panel-primary">
          <div class="panel-heading">[email protected]</div>
          <div class="panel-body">
             <div class="col-md-3">
                <div class="panel panel-default center">
                   <div class="panel-heading"><strong>I</strong></div>
                   <div class="panel-body">
                      D        
                   </div>
                </div>
             </div>
             <div class="col-md-3">
                <div class="panel panel-default center">
                   <div class="panel-heading"><strong>E</strong></div>
                   <div class="panel-body">
                      -        
                   </div>
                </div>
             </div>
             <div class="col-md-3">
                <div class="panel panel-default center">
                   <div class="panel-heading"><strong>L</strong></div>
                   <div class="panel-body">
                      a        
                   </div>
                </div>
             </div>
             <div class="col-md-3">
                <div class="panel panel-default center">
                   <div class="panel-heading"><strong>C</strong></div>
                   <div class="panel-body">
                      r        
                   </div>
                </div>
             </div>
             <div class="col-md-3">
                <div class="panel panel-default center">
                   <div class="panel-heading"><strong>R</strong></div>
                   <div class="panel-body">
                      o        
                   </div>
                </div>
             </div>
          </div>
       </div>
    </div>
    </div>



33.6k
Accepted
answer
edited Jun '16

Probably a bug, can you please post this on Github as a new issue?



44.8k

Kade Hafen the kinds of people who look at the forum everyday are not necessarily able to help with internal possibly buggy stuff. You'd probably have a better time of it if you kept the forum to posting questions about topics where you simply lack understanding but are somewhat confident that Phalcon is working correctly.