KItis KItis - 1 year ago 71
PHP Question

What is the difference between $this->render() and $this->redirect()

I am new to the Yii framework and I would like to know the difference between


Both can be used to retrieve a given page.

Answer Source

It looks like they do quite different things:

  • ->redirect($url, ...)
    redirect does a HTTP page redirect. Does not directly render a page.

  • ->render($view, ...)
    render outputs the named view. Does not terminate the current PHP request.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download