não!

jamais usa html no controler...

coloca isso numa view

e da um load na view com o terceiro parametro como true

Returning views as data

There is a third *optional* parameter lets you change the behavior of the
function so that it returns data as a string rather than sending it to your
browser. This can be useful if you want to process the data in some way. If
you set the parameter to true (boolean) it will return data. The default
behavior is false, which sends it to your browser. Remember to assign it to
a variable if you want the data returned:
$string = $this->load->view('myfile', '', true);




que dai ele retorna o conteudo para uma variavel e nao imprime!



Em 30 de abril de 2012 19:28, Marcelo Florindo
<[email protected]>escreveu:

> Boa Noite colegas,
>
> Poderia eu fazer isto no controller:
>
>    public function listar($selecao){
>
>         $string = '';
>        foreach ($selecao->result() as $row)
>        {
>           $string.='<tr class="gradeU">';
>           $string.='<td>'.$row->id_moeda.'</td>';
>           $string.='<td>'.$row->moeda.'</td>';
>           $string.='<td>'.$row->simbolo.'</td>';
>           $string.='<td
> class="center">'.$row->data_ultima_atualizacao.'</td>';
>           $string.='<td class="center">'.$row->data_inclusao.'</td>';
>           $string.='</tr>';
>
>        }
>
>        return $string;
>    }
>
> Falo no sentido de acabar derrubando algum conceito do MVC.
>
> Att,
>
> --
> Marcelo
>
> ---------------------------------------------------------------------------------
> Desenvolvedor/Analista
> Sites e Sistemas
>
> ---------------------------------------------------------------------------------
>
> _______________________________________________
> [email protected]
> http://www.codeigniter.com.br
> http://mail.codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br
>
> ---------------------------
> Oportunidade de negócio
> http://www.franquiasargohost.net
> ---------------------------
>
_______________________________________________
[email protected]
http://www.codeigniter.com.br
http://mail.codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br

---------------------------
Oportunidade de negócio
http://www.franquiasargohost.net
---------------------------

Responder a