Action without View render need a redirection?

For programming and general questions on Zend Framework

Action without View render need a redirection?

Postby ale_anto on Wed Jul 04, 2012 3:43 pm

When i use an action that no need a view render i use:

Code: Select all
       $this->_helper->layout->disableLayout();
       $this->_helper->viewRenderer->setNoRender(true);


But i need to redirect to another action? There is no way to made only the action and refresh the page which come from?
ale_anto
 
Posts: 45
Joined: Thu Sep 08, 2011 11:22 am

Re: Action without View render need a redirection?

Postby ale_anto on Wed Jul 04, 2012 3:57 pm

Or better without refresh call page.
Maybe is possible only using ajax?
ale_anto
 
Posts: 45
Joined: Thu Sep 08, 2011 11:22 am

Re: Action without View render need a redirection?

Postby us2rn4m2 on Wed Jul 04, 2012 5:22 pm

Hi,
Code: Select all
    //  From norenderAction redirect to Index/index.phtml
    public function norenderAction() {
        $this->_redirect('/');
    }   
   
    //  From norenderAction redirect to Index/hello.phtml
    public function norenderAction() {
        $this->_redirect('Index/hello'); // no suffix '.phtml'
    }      
   
    //  From Index/index.phtml redirect to Index/hello.phtml
    public function indexAction() {
        $this->_forward('hello'); // no suffix '.phtml'
    }      

more and more here: http://framework.zend.com/manual/en/zen ... lpers.html
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: Action without View render need a redirection?

Postby ale_anto on Thu Jul 05, 2012 8:08 am

Oh yes, i used this.
But all of this make a refresh of the page which make the call (go to the action e go back to first page). So also if no necessary i need to re-call the page (for example recall a database list query).
What i need now is to call a function without exit (or refresh) from first page. At the moment i can make this only with an ajax call.
ale_anto
 
Posts: 45
Joined: Thu Sep 08, 2011 11:22 am

Re: Action without View render need a redirection?

Postby us2rn4m2 on Fri Jul 06, 2012 5:24 pm

Ok, I've got something for you
Your project was interesting for me so I have created a little project call ' projectNoRefresh'.
With this instructions: Redirect + noRefresh + no recall data + no Ajax

You can dowload it (no virus): http://dl.free.fr/oYtALqj19
Install on your server and go to -> public/ and after go to -> public/norefresh

You can explore (read) all the files here:
https://docs.google.com/open?id=0B5oQfOtQlgrETndjYnlBMTBUSTQ

If you test tell me if that's what you want.
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 7 guests