Sunday, March 18, 2012

How do I redirect?

I have the following code:

class TestsController extends AppController {   public function index()   {     print 'in the index';   }    public function change()   {     print 'before redirect';     $this->redirect(array('controller' => 'test', 'action' => 'index'));     print 'after redirect';   } }
 

When I visit www.mysite.com/test/change/ I get a page with "before redirect" and the URL is still www.mysite.com/test/change/. I don't get "after redirect" or "in the index". What am I doing wrong?

Thanks

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate