Download the PHP package dnl/mthaml-bundle without Composer
On this page you can find all versions of the php package dnl/mthaml-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mthaml-bundle
MtHaml Bundle
HAML Symfony bundle using the MtHaml PHP HAML parser.
Features
- Acts as a Twig preprocessor: Supports Twig functions, filters, macros, blocks, inheritance, expressions and every Twig features
- Mix Twig and HAML templates: You can include, extend, use and import Twig templates from HAML templates, and vice versa.
- High performance: Templates are compiled to PHP code and cached, no parsing or runtime overhead.
- HAML syntax supported by editors
Installation
Step 1: Download MtHaml and MtHamlBundle
Ultimately, the MtHaml files should be downloaded to the vendor/MtHaml directory, and the MtHamlBundle files to the vendor/bundles/MtHamlBundle directory.
This can be done in several ways, depending on your preference. The first method is the standard Symfony2 method.
Using Composer
(You can skip Step 2 if you are using this method as Composer will handle autoloading for you.)
Using the vendors script
Add the following lines in your deps file:
Now, run the vendors script to download the bundle:
Using submodules
If you prefer instead to use git submodules, the run the following:
Step 2: Configure the Autoloader
You can skip this step if you used composer to install the bundle.
Add the MtHaml
and MtHamlBundle
namespaces to your autoloader:
Step 3: Enable the bundle
Finally, enable the bundle in the kernel:
Step 4: Configure the MtHamlBundle
(This is required, for Symfony to load the bundle configuration.)
Step 5: Use it
With the @Template() annotation:
With the @Haml() annotation:
The @Haml
annotation is a sub class of @Template
with engine
set to haml
by default.
With ->render()
With FOSRestBundle:
Syntax
See MtHaml docs
Commands
mthaml:debug:dump
The mthaml:debug:dump command compiles a HAML templates into Twig and displays the resulting Twig template.
For debug purposes.
Example:
php ./app/console mthaml:debug:dump AcmeDemoBundle:Demo:index.html.haml