4 thoughts on “CakePHP – Create Controller Action without View”
I did that but it displays a blank page. And what i want is to be redirected to some other view which obviously do exists.
Yes, i’m using the redirect call !
But what you said doesn’t work the way I want.
Do you have any other possible solution??
(i want my action to work like the delete action works: do “something”, doesn’t have an associated view, executes the action and voila! redirects to somewhere).
obviously in my controller, and it worked perfectly.
the new registration was added and then was redirected to sales… I think that it is what you need, none “page in blank”
I did that but it displays a blank page. And what i want is to be redirected to some other view which obviously do exists.
Yes, i’m using the redirect call !
But what you said doesn’t work the way I want.
Do you have any other possible solution??
(i want my action to work like the delete action works: do “something”, doesn’t have an associated view, executes the action and voila! redirects to somewhere).
Hope you can help me,
Best regards.
….
well, I did this:
$this->Sale->save( array( ‘Venta.id’ => 3 ), array( ‘Sale.id’ ) );
$this->autoRender = false;
$this->redirect( ‘/sales’ );
obviously in my controller, and it worked perfectly.
the new registration was added and then was redirected to sales… I think that it is what you need, none “page in blank”
the autoRender isn’t necessary when using redirect as redirect exit()’s the script after sending the redirect-header.
thanks for the article.