paulredmond/cakephp-twig — pull request #2 by paulredmond (2012-07-21 23:03:23+00:00)
Title: This is not ready for merge yet, but things are getting close.

2.0-wip is getting out of hand, and future work will be done in features
to try to break up the work better.

2.0 is still experimental, but the basic goals of this update are functional. The new version
does not currently support existing ```.ctp``` views very gracefully, but new projects or even plugins
that configure Twig as the view class will benefit from new syntax ```{% extends 'App:Layouts:default.html.twig %}```

Basic Features

* New View::render() syntax that matches Symfony2
* PHP 5.3+ only (this is a feature :)
* Composer support for vendors
* Autoloading via composer
* TwigPlugin library
* TemplateNameParser - parses string representing a view path and converts it into a TemplateReference
* TemplateReference
* FilesystemLoader - Custom twig file system loader to parse and locate templates.
* Template path caching via plugin console command

Controllers can call render like so:

```
return $this->render(':Articles:index.xml.twig'); // In this case, you could do App:Articles:index.xml.twig too.
```

Or a plugin:
```
return $this->render('Plugin:Controller:file.format.twig');
```
----------

The plugin's Cake shell is not located ATM, so symlinking to app/Console/Command is required.
This has been developed mostly in a CakePHP 2.0 environment and testing within the >= 2.1.0 is still needed.
Console for warming up template paths is very clunky ATM.
Extra checking of App paths is needed because Twig throws an exception if you configure a non-existent path.