Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Template name having double dots causes problem in v1.7.3
  • As title suggests,

    If smarty template has double it dot it fails to forge view. See below example:-

    $view = \View::forge('example.html.smarty');

    If I rename the file to example.smarty it works like:-

    $view = \View::forge('example.smarty');

    I surely need to use double dots because, my site has two formats, one is html and
    other is text only. So I load templates based on what format user has selected.

    I have smarty templates in two formats like header.html.smarty and header.txt.smarty
    and load whichever format is selected
  • Use something else than a dot.

    For Views, a dot translates to a directory, so "example.html.smarty" will attempt to load "/views/example/html.smarty".
  • That's bad. It was working v1.7.2

    Why should dot translate to a directory btw? I mean is there any specific reason that forced FuelPHP team to translate dot to a directory.

  • Ah, wait, sorry, my bad.

    When you do use

    $view = \View::forge('example.html.smarty');

    what is the exact error message you get? On what line?
  • This was the commit that broke it: https://github.com/fuel/core/commit/2c8b0ee0bd7c56b9dbad18b209e008d271334ed3

    It revealed a bug that has been present in the parser all along, which does not support the double dots.

    I've pushed the fix, you need to upgrade your parser package to 1.8/develop to use it.

Howdy, Stranger!

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

In this Discussion