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.

Passing object with built html code to view

Hello, I am trying to build a html table from database. I found difficilties passing some html and value as object to Volt. Maybe someone has anything to offer?

 $users = User::find();

        foreach ($users as $user) {

            $this->view->name .= '<td>'.$user. '<\td>'->name;


edited Dec '17

Im not 100% sure what you want to achieve, but maybe this example could help?

// Controller code
$this->view->users = User::find();

// Volt
        {% for user in users %}
            <td>{{ }}</td>
            <td>{{ }}</td>
            <td>{{ user.age }}</td>
        {% endfor %}

Nikolay, thank you very much. It is exactly what I need.