redirect to the view

Asked

Viewed 97 times

0

How can I redirect to cakephp based on the following code:

<noscript>  
//redirecionamento aqui  
</noscript>  

I’m using:

<noscript>  
<meta http-equiv="refresh" content="1; url=error.ctp">  
</noscript>   

is giving the error that in the controller there is no error action.

View does not allow $this->redirect();

How do I do it. I know it is not the convension of cake. If someone orients me also in this detail, I am grateful.

  • What version of your Cakephp?

  • How exactly would you like to do it? Once the user enters the page, they are already redirected to another?

1 answer

0

Mount the url as follows and replace with:

$url = Router::url([
    'plugin' => 'seu plugin ou null',
    'controller' => 'seu controller',
    'action' => 'sua action',
    '_full' => true // essa é opcional, se quiser q monte a url completa, coloque como true, senão, só tirar
]);

<noscript>  
    <meta http-equiv="refresh" content="1; url=<?php echo $url ?>">  
</noscript>  

Browser other questions tagged

You are not signed in. Login or sign up in order to post.