Download the PHP package splashsky/modello without Composer

On this page you can find all versions of the php package splashsky/modello. 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 modello

Modello - simple, lightweight template compiler

Modello is a super-simple, super-lightweight templating engine written in PHP. It's purpose is to be a standalone class that can be included in any project and used to quickly and efficiently parse/compile a template.

Contributing

While I don't intend for this to become a replacement for other templating solutions, I felt it would be fun to make a simple little compiler for small projects. The goal is ease of use and compactness, and hopefully my work reflects that.

If you have ideas, or want to contribute some code, feel more than welcome to open an Issue or a Pull Request. Thanks for dropping by!

Getting Started

The easiest way of using Modello in your project is Composer.

Otherwise, you can download the .zip or clone the project using Git. After that, move the Modello.php class file to wherever you want!

How do I start up the compiler?

Modello is easy to get started with.

The first argument for the constructor tells Modello where your template directory is, and this will be the root from which Modello looks for template files. The second argument tells Modello where to create the compiled views.

$modello->setViews(string $viewPath) and $modello->setCache(string $cachePath) are available to change the views and cache directories at runtime.

Using $modello->setExtension(string $extension) allows you to change the extension Modello looks for on template files - by default this is .mllo.php.

You can use $modello->setCacheEnabled(bool $enabled) to enable or disable caching - disabled means that Modello will re-compile the view on every render.

How do I compile a template?

Simply call $modello->view()!

When telling Modello what template to render, ensure you're not adding the extension - only use the name of the template. Modello will use whatever extension it has set when it looks for your file. You can use dot notation as well, so 'foo.bar' is as valid as 'foo/bar'.

The second argument in the view() function is your data array - these key => value pairs will be extracted into the resulting template.

When a template is compiled for the first time - or if Modello detects the original template file has changed - it will generate a newly compiled version of the template and store it in the cached directory for faster subsequent renders.

What syntax can I use in the template?

Modello uses template syntax very similar (basically identical) to Laravel Blade. Here's the directives it currently supports:

As long as the data you provide the directives is valid PHP, it will work!

For the include directive, it will look for the template you specify relative to the template directory you gave to Modello. If it cannot find the template you specify, it will return "path/to/template.php could not be found", which will show up in your HTML.

What if I just need to parse?

Modello still has the classic parsing functionality from before - in the static method parse().

Of course, you won't have access to any of the directives or other features of a compiled template.

License

Modello is completely free, open source software. It's covered under the MIT license, and you can read the details in the license.md.


All versions of modello with dependencies

PHP Build Version
Package Version
No informations.
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 splashsky/modello contains the following files

Loading the files please wait ....