Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
controller difference and direct access
  • K before I start, these are actually two questions but are technically related! 1- I'm still not sure what the difference is between a controller and template_controller. Can't you use the same functions in both of them?
    I suppose you can compare a template_controller with some kind of master page? But even so, you can apply the same code to both of them, no? 2-Let's say you include content using the following codes:
    view
    <div id="content">
                <?php echo $content; ?>
            </div>
    
    controller
    $this->template->content = View::factory('test/index', $data);
    

    How can you restrict the direct access on test/index? thanks in advance
  • The Template Controller is just a normal controller with a few conventions included. We say that Fuel is as conventionless as possible, so we make this template functionality as an optional extra you can use if you have read the documentation and understand it. It essentially has a master "template" view which acts as a wrapper. So instead of $this->response->body you do $this->template->body and the response will be wrapped in your "wrapper template".

Howdy, Stranger!

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

In this Discussion