2017 © Pedro Peláez
 

fuel-package fuel-parser

FuelPHP 1.x Parser Package

image

feldsam-inc/fuel-parser

FuelPHP 1.x Parser Package

  • Thursday, May 3, 2018
  • by feldsam
  • Repository
  • 1 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 45 Forks
  • 0 Open issues
  • 7 Versions
  • 46 % Grown

The README.md

Parser package

Installing

Simply add parser to your config.php always_loaded.packages config option., (*1)

Included Parsers

  • Markdown - A PHP version of Markdown by Michel Fortin.

Usage

// old usage still valid, will load app/views/example.php
View::forge('example');

// load a Mustache template, will load and parse app/views/example.mustache
View::forge('example.mustache');

// load a Twig template, will load and parse app/views/example.twig
View::forge('example.twig');

// load a Hybrid Haml / Twig template, ATTENTION: this one expects app/views/example.twig and {% haml %} code at the top of the view
View::forge('example.mthaml');

// load a Jade template, will load and parse app/views/example.jade
View::forge('example.jade');

// load a Haml template, will load and parse app/views/example.haml
View::forge('example.haml');

// load a Smarty template, will load and parse app/views/example.smarty
View::forge('example.smarty');

// load a Lex template, will load and parse app/views/example.lex
View::forge('example.lex');

// load a Dwoo template, ATTENTION: this one expects app/views/example.tpl
View::forge('example.dwoo');

// load a Handlebars template, will load and parse app/views/example.handlebars
View::forge('example.handlebars');

Installing parsers

To be able to use one of the supported parsers, you need to install them via composer. Simply add the libraries to your project's composer.json then run php composer.phar install:, (*2)

{
    "require": {
        "dwoo/dwoo" : "*",
        "mustache/mustache" : "*",
        "smarty/smarty" : "*",
        "twig/twig" : "2.*",
        "mthaml/mthaml": "*",
        "pyrocms/lex": "*",
        "zordius/lightncandy" : "dev-master"
    }
}

Note that the Markdown parser is installed by default, as it is also used by the FuelPHP core class Markdown., (*3)

Libraries that can not be installed through composer are expected to be installed in in APPPATH/vendor/lib_name (capitalize lib_name), and you'll have to download them yourself. Don't change the casing or anything, keep it as much original as possible within the vendor/lib_name dir to keep updating easy (also because some come with their own autoloader)., (*4)

You can configure them to be loaded from other locations by copying the parser.php config file to your app and editing it., (*5)

Config and runtime config

Currently the drivers still lack a lot of config options they should probably accept. They are currently all configured to work with one instance of their parser library, which is available to config:, (*6)

// Clear the cache for a specific Smarty template
$view = View::forge('example.smarty');
$view->parser()->clearCache('example.smarty');

// Example static usage
View_Smarty::parser()->clearCache('example.smarty');

The Versions

03/05 2018

dev-1.9/develop

dev-1.9/develop https://github.com/FELDSAM-INC/fuel-parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team
by Kristian Feldsam

03/05 2018

1.9-BETA1

1.9.0.0-beta1 https://github.com/FELDSAM-INC/fuel-parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team
by Kristian Feldsam

18/04 2018

1.8.1

1.8.1.0 https://github.com/fuel/parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team

12/01 2017

dev-1.8/master

dev-1.8/master https://github.com/fuel/parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team

12/01 2017

1.8.0.4

1.8.0.4 https://github.com/fuel/parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team

12/03 2016

1.8.0

1.8.0.0 https://github.com/fuel/parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team

20/05 2015

dev-1.7/master

dev-1.7/master https://github.com/fuel/parser

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team