Welcome Guest, Not a member yet? Register   Sign In
calling function in same controller
#1

[eluser]welzai[/eluser]
hi guys, i am needing from help, i don't work call one function of same controller.

i call one function e no have problem, but in last line i try redirect for other function e same controller e don't work...

somebody know what problem

below is my function

Code:
function Inserir()
      {
        $dados = array();
        
    $dados['IdFinanceira'] = $this->Proximo_codigo('IdFinanceira','Financeira');
          
        if ($this->input->post('Nome'))
          $dados['Nome'] = $this->input->post('Nome');
                          
        $this->Financeira->Inserir($dados);//function of model work.
        $this->Listar;// function of same controller it don't work
      }

the function Listar();
Code:
function Listar(){
        $this->table->set_heading('Codigo', 'Nome','Ações');
        $this->table->set_template($this->layoutTabela);
        $financeiras = $this->Financeira->ListarTodos();
        foreach ($financeiras as $financeira){
              $this->table->add_row($financeira->IdFinanceira,$financeira->Nome,'<a >IdFinanceira.'>&nbsp;<img src="/Emprestimo/imagem/Adicioonar.png" align = "center" border="0" title="Editar Perfil" /></a> <a >IdFinanceira.'>&nbsp;<img src="/Emprestimo/imagem/Deletar.png" align = "center" border="0" title="Editar Perfil" /></a>');
          }
          $data['tabela'] = $this->table->generate();
          $configuracao['tipoAcao'] = 'Listar';
        $configuracao['pagina'] = 'Financeira_ctl';
          $this->CarregaTemplate('listar',$data,$configuracao);
}
#2

[eluser]rogierb[/eluser]
$this->Listar = variable
$this->Listar() = method
#3

[eluser]welzai[/eluser]
thank's rogierb, but i already tried this way too... e
don't work.
#4

[eluser]rogierb[/eluser]
Maybe a {} problem? Can you check if the Listar method is inside the class?

Just a tip, don't use CamelCase. It might get you in trouble on certain servers.
#5

[eluser]welzai[/eluser]
Ok, yes the Listar it's in same class.

basically this function is to redirect to other view, before
execute the Inserir() function.

The function Inserir works well, the problem it's when i call Listar function inside Inserir function,
but when i call just Listar works.




Theme © iAndrew 2016 - Forum software by © MyBB