2017 © Pedro Peláez
 

library parser

Fuel PHP Framework - Version 1 - PSR-4 Parser Package

image

fuel/parser

Fuel PHP Framework - Version 1 - PSR-4 Parser Package

  • Saturday, May 19, 2018
  • by WanWizard
  • Repository
  • 10 Watchers
  • 65 Stars
  • 209,558 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 45 Forks
  • 2 Open issues
  • 7 Versions
  • 10 % 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 actually loads 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 Plates template, will load and parse app/views/example.plates
View::forge('example.plates');

// 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 actually loads app/views/example.tpl
View::forge('example.dwoo');

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

// load a Plates template, ATTENTION: this one actually loads app/views/example.tpl
View::forge('example.plates');

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": "*",
        "league/plates" : "3.*",
        "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

19/05 2018

dev-develop

dev-develop https://github.com/fuel/parser

Fuel PHP Framework - Version 1 - PSR-4 Parser Package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fuel PHP Framework Development Team

parser fuelphp fuel v1

19/04 2018

dev-1.9/develop

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

FuelPHP 1.x Parser Package

  Sources   Download

MIT

The Requires

 

by FuelPHP Development Team

18/04 2018

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

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

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