Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Suggestion: add configurablebase_path to view class
  • Hi guys, I have a suggestion for making the view class more configurable, by adding a public base_path variable to the class. The base_path variable would default to 'views', but can be changed so view files can be placed completely outside the application folder (e.g. for designers). The addition requires the constructor, the factory and the set_filename functions to be slightly modified. I've modified the view class locally and here it works fine. Would there be interest in incorporating it in the framework? I'm not entirely sure what the right procedure is for forking the framework. Also I don't know the framework structure enough to estimate if this change would break other stuff. Regards, Michiel
  • This is something being looked at ( by me ;) ) in the context of a theme/template engine, but that's not going to be for the immediate future. It will probably be released as a package, so you can choose to use it or not.
  • In the meantime, you can just extend the view class, and add your own filename logic in there.
    <?php
    class View extends Fuel\Core\View {
    
        // your thing here
    }
    
    and store in as app/classes/view.php. Don't forget to activate it in you app's bootstrap.php. An example is already present.

Howdy, Stranger!

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

In this Discussion