Welcome Guest, Not a member yet? Register   Sign In
parser array
#1

[eluser]Unknown[/eluser]
Sorry for my bad English.

I am having problems using the parser codeigniter using arrays larger than two dimensions.

Could someone show me what I'm doing wrong?

I need to create loops within loops.

thanks

array
Code:
$unidade = array(
            array('unidade' => 'Teste'),
            array('unidade' => 'Teste2')
        );
        
        $this->template->tag('loopEntidade', array(
            array('entidade' => 'Teste', 'loopUnidade' => $unidade),
            array('entidade' => 'Teste2' , 'loopUnidade' => $unidade)
        ));

view
Code:
<table class="sortable" class="sortable">
    <tr>
        {loopEntidade}
            <tr><th colspan="6">{entidade}</th></tr>
                {loopUnidade}
                    <tr><th colspan="6">{unidade}</th></tr>
                        {loopSetor}
                            <tr><th colspan="6">{setor}</th></tr>
                                
                                <tr>
                                    <th>Telefone</th>        
                                    <th>Usuário</th>
                                    <th>Referência</th>
                                    <th>Total</th>
                                    <th>Restituido</th>
                                    <th>Corrigido</th>
                                </tr>
                                {loopLigacao}
                                <tr>        
                                    <td>{entidade}</td>        
                                    <td>{operadora}</td>
                                    <td>{referencia}</td>
                                    <td>{total}</td>        
                                    <td>{restituido}</td>
                                    <td>{corrigido}</td>        
                                </tr>
                                {/loopLigacao}
                        {/loopSetor}
                {loopUnidade}
        {/loopEntidade}
</table>
#2

[eluser]quickshiftin[/eluser]
Have you tried using the php tags instead of notation with braces? Might be easier to track down the problem.




Theme © iAndrew 2016 - Forum software by © MyBB