Tim Joyce
Tim Joyce

Reputation: 4517

Redirect without Auth Component

Is there a way to redirect in cakephp without using the Auth component? I don't have a database or a need for one so I do not have a users table to be able to instantiate the Auth component to use redirects. When I put a regular header redirect, it won't work because there is already an output to the page.

Cakephp 2.2

Thanks

Upvotes: 0

Views: 118

Answers (1)

fsilva
fsilva

Reputation: 71

You can use redirect method of the controller:

class OrdersController extends AppController {

    public function add() {
      ...
      $this->redirect('/orders/thanks');
    }

I would do all necessary output for you. For more information see the CakePHP manual at http://book.cakephp.org/2.0/en/controllers.html#flow-control

Upvotes: 1

Related Questions