Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Phil's template library
  • I really like Phil's template library he created for codeigniter (link) Just wondering if someone can port this over to fuelphp? I would love to do it but my knowledge on php namespace is limited.
  • As much as I know... Phil is our Phil Sturgeon (one of Fuel's main developers)! He could port it to Fuel by himself! =]
  • I'm aware of that and i'm sure he's got plenty of other things to worry about like the core fuelphp etc.
  • Fuel already contains a template class in the core. http://fuelphp.com/docs/general/controllers/template.html Were you looking for some specific functionality?
  • drifitz drifitz wrote on 03/21/11 2:16 pm:
    Fuel already contains a template class in the core. http://fuelphp.com/docs/general/controllers/template.html Were you looking for some specific functionality?

    To have a seperate themes for the frontend and admin. This is the structure using Phil's library: ---themes
    default // theme 1
    css
    img
    js
    admin // theme 2
    css
    img
    js Not sure if the template class allows you to do that? Thanks.
  • No, it doesn't. I'm working on a theme engine at the moment, but first some issues regarding the autoloading of files need to be fixed. Currently you can't set a searchpath for a single load request, paths are global. Which makes it impossible to switch themes. And I prefer to have themes behave more like modules. Which means you do not only include the view (templates, chrome, etc) but also code (controllers, viewmodels, etc) which allows for more dynamic themes, theme installers, widgets with theme options, etc...
  • Harro Verton wrote on Saturday 26th of March 2011:
    No. All focus is on a stable RC at the moment.
    And it's unlikely (but haven't discussed it) that it will be part of the core. It will probably be a package.
    Hopefully any news here?
  • Harro Verton wrote on 03/21/11 11:17 pm:
    No, it doesn't. I'm working on a theme engine at the moment, but first some issues regarding the autoloading of files need to be fixed. Currently you can't set a searchpath for a single load request, paths are global. Which makes it impossible to switch themes. And I prefer to have themes behave more like modules. Which means you do not only include the view (templates, chrome, etc) but also code (controllers, viewmodels, etc) which allows for more dynamic themes, theme installers, widgets with theme options, etc...
    You guys are great... thank you so much. Thank you :)
  • A new theme class was introduced in v1.1. It does templating, it doesn't do partials yet. I'm working on that right now, but there is some debate on whether or not this should be part of the core.
  • Harro Verton wrote on 2011-03-21:
    No, it doesn't. I'm working on a theme engine at the moment, but first some issues regarding the autoloading of files need to be fixed. Currently you can't set a searchpath for a single load request, paths are global. Which makes it impossible to switch themes. And I prefer to have themes behave more like modules. Which means you do not only include the view (templates, chrome, etc) but also code (controllers, viewmodels, etc) which allows for more dynamic themes, theme installers, widgets with theme options, etc...

    Hi WanWizard, is the theme engine likely to be in rc1 release? Thanks
  • No. All focus is on a stable RC at the moment. And it's unlikely (but haven't discussed it) that it will be part of the core. It will probably be a package.
  • For now you can just create your own basic themeing by creating a Controller_Front extends \Controller_Template and modify some of the behavior. Set a theme variable in the before by pulling from the DB, session, whatever then use it to load views. fuel/app/views/<theme>/foo.php Pass the $theme var as a static property of the controller:
    $this->response->body = View::factory(static::$theme.'/foo.php');
    

    Basic, but it 'll work.
  • Thanks Phil.

Howdy, Stranger!

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

In this Discussion