Download the PHP package rodnaph/morgan without Composer

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

Morgan - Pure HTML Templating for PHP Build Status

Morgan is a small templating library for PHP to enable using 'pure HTML' templates. This means that no templating is included in your HTML files, they are meant to be fully standalone components that you can view and edit independently. Morgan then handles transforming these templates using your application data.

Morgan is a PHP port of the ideas from EnLive.

Usage

If you want to dive straight in there's an example application with more details.

Here, we're rendering a template using a HTML file we have. When we call render we pass the name of the source file, and an array of key/value pairs where the keys are CSS selectors to match elements in the document, and the values are functions to transform those elements.

So in the above example we're selecting all h1 elements inside .header elements, and then we're setting their content to the string 'Some Text'. T::render() will echo the content of the template, you can also use T::fetch() to just return the transformed content.

You can also get handles to Callable template functions like this...

Transformers

In the above simple example the transformer we used was the content transformer. There are other transformers available…

Custom Transformers

You can also create your own transformers, they are just functions which accept a DOMElement object and mutate it in some way.

Multi Transforms

Often you'll want to apply multiple transformers to a given selector. You can do this by using the all form.

Snippets

As well as entire documents, you can also create snippets. These are fragments of some document, and you can use them for things like extracting a blog post from a HTML file, then rendering this post in another template.

The second argument is the CSS selector for selecting the fragment from the document.

Less Trivial Example

As a more fully featured example, imagine you have a page where you want to list a bunch of blog posts. This page will contain a title, then a list of blog post subjects with a short summary of their content (the title linking to each post).

We can markup this in a single file called blog-posts.html, then use it as the template for our page, extract the example snippet for a blog post in summary view to use for the blog posts.

Object Orientated Usage

As well as the static interface you can also use Morgan in an OOP manner if you like.

Installation with Composer

Morgan is available via Composer, just require it and specify the version you want to use.

Motivation

This library was inspired by EnLive, and is mainly a just-for-fun implementation in PHP. If you find it useful though feel free to contribute!

TODO

The following functions from EnLive are not implemented yet, so I still need to review them and do that if they make sense...


All versions of morgan with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/css-selector Version dev-master
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 rodnaph/morgan contains the following files

Loading the files please wait ....