Download the PHP package mervick/yii2-mthaml without Composer
On this page you can find all versions of the php package mervick/yii2-mthaml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-mthaml
Yii2 MtHaml
The MtHaml integration for the Yii2 framework.
Extension provides a ViewRenders that would allow you to use Haml/Twig view template engines, using Multi target HAML (MtHaml) library.
Requirements
- YII 2.0
- PHP 5.4+
- Composer
Installation with Composer
Installation is recommended to be done via composer by running:
Also for using twig:
Usage
Add this to your config/main.php file:
Rendering in Controllers:
MtHaml Options
This is default options:
Filters
Filters take plain text input (with support for #{...} interpolations) and transform it, or wrap it. Learn more
The following filters are available by default:
css: wraps with style tagscdata: wraps with CDATA markupescaped: html escapesjavascript: wraps with script tagsphp: executes the input as php codeplain: renders as plain textpreserve: preserves preformatted text
Filters which not enabled by default:
coffee: compiles coffeescript to javascript- dependence
coffeescript/coffeescript "~1"(CoffeeScript)
- dependence
less: compiles as Lesscss- depends one of following:
oyejorge/less.php "*"(OyejorgeLess)
orleafo/lessphp "*"(LeafoLess)
- depends one of following:
scss: converts scss to css- dependence
leafo/scssphp "*"(Scss)
additionally, to use Compassleafo/scssphp-compass "dev-master"
- dependence
markdown: converts markdown to html- depends one of following:
michelf/php-markdown "~1.3"(MichelfMarkdown, MichelfMarkdownExtra)
orcebe/markdown "~1.0.1"(CebeMarkdown, CebeMarkdownExtra, CebeGithubMarkdown)
orerusev/parsedown "*"(Parsedown)
orleague/commonmark ">=0.5"(CommonMark)
orkzykhys/ciconia "~1"(CiconiaMarkdown)
orfluxbb/commonmark "~1@dev"(FluxBBMarkdown)
- depends one of following:
rest: converts reStructuredText to html- dependence
gregwar/rst "~1"(ReST)
- dependence
To enable non default filters you must first install them via composer.
Example, install coffee filter:
After what include it in your config file:
List of all the filters with default options:
Twig Extensions
The Twig Extensions is a library that provides several useful extensions for Twig.
Install via Composer:
Add the following lines to config file:
Attention!
Inside the templates you must use $view instead of $this, example:
License
MtHaml extension for Yii2 Framework is released under the MIT license.