Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runekaagaard/php-chano
A non compiled pure PHP template engine with features comparable to Django Template Language.
https://github.com/runekaagaard/php-chano
Last synced: 11 days ago
JSON representation
A non compiled pure PHP template engine with features comparable to Django Template Language.
- Host: GitHub
- URL: https://github.com/runekaagaard/php-chano
- Owner: runekaagaard
- Created: 2010-12-06T14:50:36.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-01-30T11:13:09.000Z (almost 13 years ago)
- Last Synced: 2024-11-07T11:48:16.823Z (2 months ago)
- Language: PHP
- Homepage: http://readthedocs.org/docs/chano/en/latest/
- Size: 820 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
## Chano ##
Chano is an almost direct port of Djangos Template Language to PHP. But where
Django uses its own template language, Chano is implemented as a PHP iterator
that lets you iterate over an array, stdClass or Iterator and manipulate its
content in a variety of ways, matching the capabilities of the Django Template
Language.Besides from being able to iterate over data, all the Chano functions can also
be called on non iterable values.Read the docs at http://chano.readthedocs.org/.
## Example ##
Below follows an example of what a template using Chano could look like:
```php
=Chano::with($title)->upper()?>
Showing =$movies->length()?> movie=$movies->pluralize()?>
=$m->counter()?>)
=$m->title->upper()?>
Rating=$m->ratings->pluralize()?>
=$m->ratings->join()?>
Link=$m->links->pluralize()?>
links->length() < 3):?>
=$m->links->unorderedlist()->urlize()?>
=$m->links->unorderedlist()->urlizetrunc(12)?>
```
## Tests ##
Chano is pretty well tested with PHPT. I was able to port most of the tests for
the functions directly from Django and then add integration tests to those.See: https://github.com/runekaagaard/php-chano/tree/master/tests.