Download the PHP package scil/mthaml-more without Composer

On this page you can find all versions of the php package scil/mthaml-more. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mthaml-more

MtHamlMore

Add some features like snippet to MtHaml, main purpose is “Don't Reinvent the Wheel".

Both php and Twig are supported.

Install method: add to composer.json, see details at docs.

Main Feature :snip

if there is a box structure which is used many times, you can define it as a snip,for example

write haml like so:

output html :

'@@@' is a placeholder where you can put your own content,and you could define default value for it, or even set global placeholder default value use option 'globalDefaultPlaceholderValue', that's useful if you want all placeholder rendered to empty string when you forget apply placeholder value.

second example: inline placeholder snips:

haml:

output:

third example

This is calling a snip named grid, and two arguments. Usually, I use snip @grid to define grid layout. 'fluid="1"' is fluid layout, 'grid="4 -4 4" is one type of 12 columns grid. What this statement output depends on how your snip writes. In 'examples/snips/php.php', there is an snip which defines Twitter Bootstrop v2 grid. In case of this,output would be

Attribute values can be writed as named placeholdervalue

is equal with

Please note, this form is not treated as attribute value

And

equals with

see more examples at : "docs/0. Snip Examples.md"

Extra Feature 1 : HtmlTag

html tags can be used like haml tag ,not only

which is supported by MtHaml, but also

This feature enables you to copy any html code into a haml file, only make sure code apply haml indent syntax.

code: MtHamlMore\Parser::parseHtmlTag

Extra Feature 2 : reduce runtime

Sometimes there are some 'MtHaml\Runtime' in php files produced by MtHaml, if you dislike it ,you may try

'reduce_runtime'=>true could reduce the appearance of 'MtHaml\Runtime',or replace it with \MtHamlMoreRuntime\Runtime::renderAttribute which is much simpler.

It's not perfect,but works in normal situation.

Works well for these haml:

Not works

  1. there is 'AttributeInterpolation' or 'AttributeList' in php files produced by MtHaml. I have not encounter this so far.

  2. (welcome add your find)

This feature supported only for php ,not Twig.

code:

option 'reduce_runtime_array_tolerant'

The :class and :id attributes can be specified as a Ruby array, like

if no one of $position, $item2['type'], $item2['urgency'] or $item2['type'] is an array, you could add to 3rd argument of compilePhpMoreHaml. Then array flatten is not needed in this case.

code: MtHamlMore\NodeVisitor\PhpRenderer::returnJoinedValueForClassId

when option 'reduce_runtime_array_tolerant' is true , only these situations will use array flatten right now:

Extra Feature 3 : prepare

if you set options 'prepare'=>true , MtHamlMore will first execute php code defined by {% %} and {= =}.

like this:

executed to

then, to

this is normal haml code,which will be compiled to

notice: {% .. %} must monopolize one line, because regular expression uses '^' and '$'.

code: MtHamlMore\Environment::prepare


All versions of mthaml-more with dependencies

PHP Build Version
Package Version
Requires mthaml/mthaml Version >=1.3.0
phpunit/phpunit-story Version 1.*
nikic/php-parser Version 1.*@dev
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package scil/mthaml-more contains the following files

Loading the files please wait ....