You can not send output to the webpage and then redirect.
On Sunday, March 18, 2012 7:28:02 PM UTC-7, glevine wrote:
>
> 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/.<http://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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php