Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
FuelPHP for a Open Source Social Networking Script
  • I have done lot of research on various PHP frameworks and finally decided to go with FuelPHP as it looks to provide all features that it provides. Basically I want my script to support modules and themes.

    I have some few questions on FuelPHP.

    1) Where can I find document on creating new theme? The site content is not enough.

    2) I want to have all the presentation details like header, footer and sidebars common across all pages. The users who will create new plugins, need to just concentrate on the content. How can I design the themes and views based on this?

    3) I don't like to mix php code and HTML in the views. I want to make it easier for theme designers by using some templating engine like smarty or twig. Where can I find docs for configuring them in config files?

    4) Should I wait for Version 2.0 to be out or I should start using FuelPHP 1.6 version?
  • Welcome.

    1. I don't think there is.

    There isn't anything special about a theme, it's just a collection of view files in a separate folder structure instead of in app/views or in the module views folder. Other then that, they are standard views (View objects) and can be used as such.

    2. You create a page template, similar to a nested view (see http:/docs.fuelphp.com/general/views.html). Theme templates use $partials['your_partial']; where as views would use $your_partial;

    Your controller would set the template, and use HMVC calls to fetch the partials for the template. Your code should contain the logic to do an HMVC call to a plugin, which should return a View object or view filename which then can be inserted into the theme template as partial.

    3. Install the parser package.

    it comes with support for both Smarty and Twig (and a few others), and it plugs right into the View and Theme classes, just make sure your view files have the correct extension (for example view.twig instead of view.php), Fuel will take care of the rest.

    4. Depends on how much time you have. I don't expect an official 2.0 release for another 6 months.
  • Thanks for your time and your response. This is my first week with FuelPHP, so excuse my questions :)

    Before I trouble you with further questions, I would like to thank your guys for the huge effort on this framework.

    The docs has covered almost all individually. But there is not collective info.. for example: how to use i18n language strings in the Form labels. I really like to contribute back to this framework when I get confident with Fuel.

    I have a huge vision for my social networking script where few ideas are taken from Oxwall (plugin developer) and ELGG.

    It would be helpful if there is some doc on using Smarty or such engines with Fuel.
  • HarroHarro
    Accepted Answer
    Thanks, and no problem. :-)

    The current docs were designed about 3 years ago, more as an API kind of documentation. For 2.0, we're going to write more functional documentation (more like a collection of how-to's), and use PHPDocumentor for the API docs.

    There is nothing special about using a template engine with FuelPHP. Just use the parser package, as documented here: http://docs.fuelphp.com/packages/parser/intro.html. There is really nothing more to it.

Howdy, Stranger!

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

In this Discussion