Redirect cakephp

0

I have created an action where, when I click on an icon on the page, it calls this action and on itself has a redirect to the page itself. The problem is that you are not doing this redirect.

Action:

public function limpar_criterios(){
    return $this->redirect('/intercambio/pesquisa_nova');
}

Link that calls:

<a href="/limpar_criterios/inglês"><img src='/img/bandeiras/small_45x31_1.jpg' width="39" height="31" /></a>
    
asked by anonymous 01.06.2015 / 14:34

1 answer

1

The problem with your link is that the controller is clean_criterios and the action is English when in fact clean_criterios is action. Note: try not to use accents in url's.

Create the link using CakePHP HtmlHelper :

$this->Html->link(
    $this->Html->image('bandeiras/small_45x31_1.jpg', 
        array(
            'alt' => 'Imagem',
            'width' => '39',
            'height' => '31'
        )
    ),
    array(
        'controller' => 'NOME_DO_CONTROLADOR',
        'action' => 'limpar_criterios'
    ),
    array('escape' => false)
);
    
01.06.2015 / 15:25