Download the PHP package talesoft/tale-pug without Composer

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

Tale Pug for PHP

GitHub release Travis Packagist HHVM License

Finally a fully-functional, complete and clean port of the Pug/Jade language to PHP

— Abraham Lincoln

The Tale Pug Template Engine brings the popular and powerful Templating-Language PugJS, formerly Jade, to PHP!

Tale Pug is the first complete and most powerful Pug implementation in PHP right now.

Contents:


What is Tale Pug

It's a template engine that doesn't focus on abstracting PHP, but focuses on abstracting HTML.

Why another template engine?, you might ask.

Template engines like Twig or Blade are pretty cool and functional, but they all lack one common thing: HTML abstraction.

You still have to write all those tags, brackets and quotes, you have to close tags and make sure that you keep your structure consistent. It's verbose and it takes large sizes on bigger sites pretty quick.

Similar to HAML, but less verbose, Tale Pug takes both approaches, it abstracts PHP as well as HTML. It works based on indentation and simple CSS-selectors to create your HTML as clean and quick as possible. It also involves a lot of dynamic features, you won't need any line of HTML or PHP to write your templates anymore. You only need Tale Pug.

Furthermore, Tale Pug can handle different output formats through its syntax. That way you can use Tale Pug for HTML5, XHTML or XML templates just by changing the doctype and it will automatically make sure to always render valid markup.

Below you have some examples, feature-links, links to documentation and a sandbox where you can play in. Check them out!

Don't fear the syntax. Let me stress this out because I've read a lot about people being scared of Jade syntax. It is basically indented CSS-selectors and a few characters to control what you output. Once you wrote a few templates with it, I assure you, you'll love it!

Getting Started

Install with Composer

Download Composer

The composer package for Tale Pug is called talesoft/tale-pug

If you want to get started right now, hook up composer and run

or add it to your composer.json by yourself

Note: If you're not using composer, make sure to also include the Compiler/functions.php file

Rendering a Pug Template

Include the vendor/autoload.php file of composer in your PHP script and get started with Tale Pug!

This way, the renderer will search for your-pug-file.pug in your get_include_path()-paths. Notice that the path passed to render should be relative. You can give it absolute paths, but it will make caching harder.

We show you how to add alternative search paths further in the Basic configuration section below.

When the Jade-file gets rendered, a ./cache/views-directory is created automatically and the compiled PHTML will be stored in that directory.

To change this directory, use the cache_path-option

The Pug-file will now be rendered to that directory on each call.

To enable a cache that won't render the files on each call, use the ttl option of the file-adapter

Basic configuration

To enable formatting of the PHTML-output, use the pretty-option

If you don't want to use the get_include_path()-paths (which could actually harbor a security risk in some cases), pass your own search paths to the Renderer. Rendered and included Pug-files will be searched in those paths and not in the get_include_path()-paths anymore.

As soon as you pass any path, the loading from the get_include_path()-paths will be disabled and you always load from your passed directory/ies.

To pass variables to your Pug-file, use the second argument of the render-method

These can be used inside Pug as normal variables


Supported features

Tale Pug supports every single feature the original Pug implementation supports! This always has been and will always be the main target.

But why stop there? PHP has it's own features that are surely different from JavaScript's. By utilizing those features it aims to bring in more, compatible features into the language to make the fastest template development ever possible!

You can try each feature and see a bunch of examples on my sandbox site

Supported official PugJS Features

Supported Tale Pug Features

Other cool features

There's more to come...

Tale Pug is actively used and developed in many projects and is improved constantly.

It doesn't stick to the Pug-convention, but it will always provide compatibility to PugJS to help reducing confusion.

Planned features:


Documentation Resources

Tale Pug Sandbox A compiler for you to play with in your browser as well as a whole bunch of examples to give you a grasp of what Tale Pug is capable of.

The Tale Pug API Docs The documentation of the Tale Pug source code. Generated with phpDocumentor, but is's fairly enlightening.

Official PugJS Documentation The real thing. This is where everything that I do here originates from. The syntax is the same, only the code-expressions are different.

Tale Pug Bootstrap A quick-start project to get you up and running. Fork it, download it, play with it. Don't forget to run composer install before launching (Download Composer)

Development Test Files The example files I tested the engine with.

Tale Pug Unit Tests The Unit Tests I'm using to ensure stability. There will be new tests added constantly and most features are covered here. It's PHP code, though.


Tale Pug for your favorite framework

You're using a framework with a template engine already, but you really want to try out Pug? Search no further.

Thanks to the Tale Pug Community there are some modules for existing frameworks that allow you to use Tale Pug easily!

Notice that some of these have to be updated because this library has been re-named recently. Feel free to use the old Jade implementation in this case, the only thing different will be that your files have to use the .jade or .jd extension.

Laravel Framework

Symfony 2/3

Yii2 Framework

SimpleMVCFramework

CakePHP 3

FlightPHP

Symphony XSLT CMS

Your framework is missing? Send me an e-mail and we'll get a bridge up and running as soon as possible!

A great thanks to the contributors of these modules!


Get in touch and support my work

If you find a bug or miss a function, please use the Issues on this page to tell me about it. I will gladly hear you out :)

If this library helped you, eased up your work and you simply can't live without it, think about supporting my work and spend me a coffee. Thank you!

If you'd like to contribute, fork, send pull requests and I'll take a deep look at what you've been working at! Tale Pug is completely Open Source! You can do anything you like with the code as long as you stick to the MIT-license I've appended. Just keep my name somewhere around!

You can also contact me via E-Mail [email protected]

Thank you for using Tale Pug. Let us spread the Pug-language together!


All versions of tale-pug with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
talesoft/tale-config Version 0.2
symfony/polyfill-mbstring Version ^1.3.0
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 talesoft/tale-pug contains the following files

Loading the files please wait ....