Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Using of a default template
  • Hi, I have a question on the use of a default template and changing it. So I have a website which consist of a guest (normal visitor) area and admin area.
    The guest and user area would have the template page as default, the admin however would have the admin_template as default. Now I have 2 extended Controllers:
    Controller_Common -> which contains the basic 404 page and extends the template
    Controller_Admin extends Common -> which contains the login check, redirect to panel, login, logout AND the template_admin "public $template = 'template_admin';" Now for the question: My login page which will be used "Response::redirect('/admin/login');" in 2 functions (before() if loggedIn check fails and login() function) has to use the default template. As I use a redirect, will "$this->auto_render = false;" work? Off Topic:
    In the http://docs.fuelphp.com/general/controllers/template.html#omit_methods there is a small Syntax fault. A ";" is missing after "$this->auto_render = false"
  • i think the following code should work even if the autorender is false.
    $this->template->title='something';
    $this->template->content=\View::forge('login');
                $this->response->body = $this->template; // show content in template
            }
    
  • A redirect forces a HTTP redirect and exits, the whole rendering is never done. The value of $this->auto_render doesn't matter.
  • Offcourse, haven't thought about it . Thanks alot

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion