Login   Register  
PHP Classes
elePHPant
Icontem

Haanga: Template engine to process Django style templates

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (277)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2011-11-09 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 330 All time: 6,345 This week: 1,508Up
Version License PHP version Categories  
haanga 1.0BSD License5.2PHP 5, Templates, Code Generation
Description Author  

This package is a template engine that can process Django style templates.

It can parse Django style templates and compile them into PHP code that can be executed to generate the processed template output.

The engines supports variable replacement, conditional blocks, loops, external template file inclusion.

It also supports template inheritance by allowing to redefining a template based on another template.

Innovation Award  
PHP Programming Innovation award nominee
August 2010
Number 3


Prize: One year subscription to the PDF edition of the JSMag magazine
Templates are often used to render Web pages that follow the same pattern.

Sometimes you use multiple templates on a site that differ just in small details.

This package is a PHP template engine inspired on the Django Python framework template engine.

Among other features it supports defining templates that inherit their composition from other templates, thus allowing to reuse templates to minimized the template development effort.

Manuel Lemos
Picture of Cesar D. Rodas
Name: Cesar D. Rodas is available for providing paid consulting. Contact Cesar D. Rodas .
Classes: 37 packages by
Country: Paraguay Paraguay
Age: 27
All time rank: 71 in Paraguay Paraguay
Week rank: 30 Down1 in Paraguay Paraguay Equal
Innovation award
Innovation award
Nominee: 24x

Winner: 5x

  Files folder image Files  
File Role Description
Files folder imagecontrib (2 files)
Files folder imageexamples (4 files, 4 directories)
Files folder imagelib (1 file, 1 directory)
Files folder imagetests (3 files, 3 directories)
Accessible without login Plain text file LICENSE Lic. BSD License
Accessible without login Plain text file Makefile Data Auxiliary data
Accessible without login Plain text file README Data Auxiliary data

  Files folder image Files  /  contrib  
File Role Description
  Plain text file dummy.php Class Dummy custom filter
  Plain text file meneame_pagination.php Class Custom tag example class

  Files folder image Files  /  examples  
File Role Description
Files folder imagecomplex (5 files)
Files folder imagedjango-yui-layout-templates (11 files, 1 directory)
Files folder imageinheritance (3 files, 1 directory)
Files folder imagetmp (1 file)
  Accessible without login Plain text file django-yui.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file inheritance.php Example Example script
  Accessible without login Plain text file template_runtime.php Example Example script

  Files folder image Files  /  examples  /  complex  
File Role Description
  Accessible without login Plain text file base.html Data Example template
  Accessible without login Plain text file include.html Data Example template
  Accessible without login Plain text file index-test.html Data Example script
  Accessible without login Plain text file index.html Data Example template
  Accessible without login Plain text file subtemplate.html Data Example script

  Files folder image Files  /  examples  /  django-yui-layout-templates  
File Role Description
Files folder imageshared (1 file)
  Accessible without login HTML file layout_1_column_full_width.html Doc. Documentation
  Accessible without login HTML file layout_2_columns_narrow_left_column.html Doc. Documentation
  Accessible without login HTML file layout_2_columns_n...w_right_column.html Doc. Documentation
  Accessible without login HTML file layout_2_equal_columns.html Doc. Documentation
  Accessible without login HTML file layout_3_columns_q...r_half_quarter.html Doc. Documentation
  Accessible without login HTML file layout_3_columns_varying_width.html Doc. Documentation
  Accessible without login HTML file layout_3_equal_columns.html Doc. Documentation
  Accessible without login HTML file layout_4_equal_columns.html Doc. Documentation
  Accessible without login HTML file layout_base.html Doc. Documentation
  Accessible without login HTML file layout_overrides.html Doc. Documentation
  Accessible without login Plain text file README Data Auxiliary data

  Files folder image Files  /  examples  /  django-yui-layout-templates  /  shared  
File Role Description
  Accessible without login HTML file footer.html Doc. Documentation

  Files folder image Files  /  examples  /  inheritance  
File Role Description
Files folder imageshared (1 file)
  Accessible without login Plain text file layout.html Data Example template
  Accessible without login Plain text file page.html Data Example script
  Accessible without login Plain text file section.html Data Example script

  Files folder image Files  /  examples  /  inheritance  /  shared  
File Role Description
  Accessible without login Plain text file about.html Data Example script

  Files folder image Files  /  examples  /  tmp  
File Role Description
  Accessible without login Plain text file .dummy Data Dummy file to create the folder

  Files folder image Files  /  lib  
File Role Description
Files folder imageHaanga (5 files, 3 directories)
  Plain text file Haanga.php Class Main class

  Files folder image Files  /  lib  /  Haanga  
File Role Description
Files folder imageCompiler (7 files)
Files folder imageExtension (2 files, 2 directories)
Files folder imageGenerator (1 file)
  Plain text file AST.php Class Abstract Syntax Tree class
  Accessible without login Plain text file build.sh Data Script to generate lexer and parser (with phplex and phplemon)
  Plain text file Compiler.php Class Main compiler class
  Plain text file Exception.php Class Exception class
  Plain text file Extension.php Class Extension class

  Files folder image Files  /  lib  /  Haanga  /  Compiler  
File Role Description
  Plain text file Exception.php Class Compiler Exception class
  Accessible without login Plain text file Lexer.lex Data Lexer definition
  Plain text file Lexer.php Class Lexer class (generated from lexer.lex
  Plain text file Parser.php Class Parser class (Generated from Parser.y)
  Accessible without login Plain text file Parser.y Data Parser definition
  Plain text file Runtime.php Class Runtime compiler class
  Accessible without login Plain text file Tokenizer.php Test Unit test script

  Files folder image Files  /  lib  /  Haanga  /  Extension  
File Role Description
Files folder imageFilter (30 files)
Files folder imageTag (15 files)
  Plain text file Filter.php Class Filter extensions class
  Plain text file Tag.php Class Tags Extension class

  Files folder image Files  /  lib  /  Haanga  /  Extension  /  Filter  
File Role Description
  Plain text file Capfirst.php Class Capfirst filter class
  Accessible without login Plain text file Count.php Test Unit test script
  Plain text file Cut.php Class Cut fitler class
  Plain text file Date.php Class Date filter class
  Plain text file Default.php Class Default fitler class
  Plain text file Dictsort.php Class Dictsort filter class
  Plain text file Empty.php Class Class source
  Plain text file Escape.php Class Escape filter class
  Plain text file Exists.php Class Class source
  Plain text file Hostname.php Class Class source
  Accessible without login Plain text file Intval.php Test Unit test script
  Plain text file Join.php Class Join filter class
  Plain text file Length.php Class Length filter class
  Plain text file Lower.php Class Lower filter class
  Plain text file Null.php Class Class source
  Plain text file Pluralize.php Class Pluralize filter class
  Plain text file Reverse.php Class Reverse filter class
  Plain text file Safe.php Class Safe filter class
  Plain text file Slugify.php Class Class source
  Plain text file Stringformat.php Class Class source
  Plain text file Strlen.php Class Class source
  Plain text file Substr.php Class Class source
  Plain text file Title.php Class Title filter class
  Plain text file Trans.php Class Class source
  Plain text file Translation.php Class Class source
  Plain text file Trim.php Class Trim filter class
  Plain text file Truncatechars.php Class Class source
  Plain text file Truncatewords.php Class Truncatewords filter class
  Plain text file Upper.php Class Upper filter class
  Plain text file Urlencode.php Class Urlencode filter class

  Files folder image Files  /  lib  /  Haanga  /  Extension  /  Tag  
File Role Description
  Plain text file Buffer.php Class Class source
  Plain text file Currenttime.php Class Currenttime tag class
  Plain text file Cycle.php Class Cycle tag class
  Plain text file Dictsort.php Class Dictsort tag class
  Plain text file Exec.php Class Class source
  Plain text file Firstof.php Class Firstof tag class
  Plain text file Inline.php Class Class source
  Plain text file Lower.php Class Lower tag class
  Plain text file Min.php Class Class source
  Plain text file Setsafe.php Class Class source
  Plain text file Spaceless.php Class Spaceless tag class
  Plain text file Templatetag.php Class Templatetag tag class
  Plain text file Trans.php Class Class source
  Plain text file Tryinclude.php Class Class source
  Plain text file Upper.php Class Upper tag class

  Files folder image Files  /  lib  /  Haanga  /  Generator  
File Role Description
  Plain text file PHP.php Class Generator (for PHP) class

  Files folder image Files  /  tests  
File Role Description
Files folder imageassert_templates (141 files, 1 directory)
Files folder imageerr_templates (39 files)
Files folder imagetmp (1 file)
  Accessible without login Plain text file errorTest.php Test Test common errors
  Accessible without login Plain text file templateTest.php Test Template test class
  Accessible without login Plain text file TestSuite.php Test Unit testing class

  Files folder image Files  /  tests  /  assert_templates  
File Role Description
Files folder imagelocale (1 directory)
  Accessible without login Plain text file autoescape.html Data Testing file
  Accessible without login Plain text file autoescape.php Data Testing data
  Accessible without login Plain text file autoescape.tpl Data Testing file
  Accessible without login Plain text file base.html Data Testing file
  Accessible without login Plain text file base.php Data Testing file
  Accessible without login Plain text file base.tpl Data Testing file
  Accessible without login HTML file bitwise.html Doc. Documentation
  Accessible without login Plain text file bitwise.tpl Data Auxiliary data
  Accessible without login HTML file bug_001.html Doc. Documentation
  Accessible without login Plain text file bug_001.php Test Unit test script
  Accessible without login Plain text file bug_001.tpl Data Auxiliary data
  Accessible without login HTML file class_static.html Doc. Documentation
  Accessible without login Plain text file class_static.tpl Data Auxiliary data
  Accessible without login HTML file concat.html Doc. Documentation
  Accessible without login Plain text file concat.tpl Data Auxiliary data
  Accessible without login HTML file concat1.html Doc. Documentation
  Accessible without login Plain text file concat1.tpl Data Auxiliary data
  Accessible without login Plain text file custom_tag.html.php Data Testing file
  Accessible without login Plain text file custom_tag.tpl Data Testing file
  Accessible without login Plain text file cycle.html Data Testing file
  Accessible without login Plain text file cycle.php Data Testing data
  Accessible without login Plain text file cycle.tpl Data Template file
  Accessible without login Plain text file dummy.html Data Testing file
  Accessible without login Plain text file dummy.tpl Data Testing file
  Accessible without login HTML file empty_block.html Doc. Documentation
  Accessible without login Plain text file empty_block.tpl Data Auxiliary data
  Accessible without login Plain text file empty_block_base.tpl Data Auxiliary data
  Accessible without login Plain text file empty_loop.html Data Testing file
  Accessible without login Plain text file empty_loop.php Data Testing file
  Accessible without login Plain text file empty_loop.tpl Data Testing file
  Accessible without login Plain text file exec.html.php Test Unit test script
  Accessible without login Plain text file exec.tpl Data Auxiliary data
  Accessible without login HTML file expr.html Doc. Documentation
  Accessible without login Plain text file expr.php Test Unit test script
  Accessible without login Plain text file expr.tpl Data Auxiliary data
  Accessible without login Plain text file filter.html Data Testing file
  Accessible without login Plain text file filter.php Data Testing file
  Accessible without login Plain text file filter.tpl Data Testing file
  Accessible without login Plain text file first_of.html Data Testing file
  Accessible without login Plain text file first_of.php Data Template file
  Accessible without login Plain text file first_of.tpl Data Testing file
  Accessible without login HTML file foreach_vars.html Doc. Documentation
  Accessible without login Plain text file foreach_vars.php Test Unit test script
  Accessible without login Plain text file foreach_vars.tpl Data Auxiliary data
  Accessible without login HTML file for_range.html Doc. Documentation
  Accessible without login Plain text file for_range.tpl Data Auxiliary data
  Accessible without login HTML file for_range1.html Doc. Documentation
  Accessible without login Plain text file for_range1.tpl Data Auxiliary data
  Accessible without login Plain text file for_range2.tpl Data Auxiliary data
  Accessible without login Plain text file for_range3.tpl Data Auxiliary data
  Accessible without login Plain text file for_range4.php Test Unit test script
  Accessible without login Plain text file for_range4.tpl Data Auxiliary data
  Accessible without login HTML file for_range5.html Doc. Documentation
  Accessible without login Plain text file for_range5.php Test Unit test script
  Accessible without login Plain text file for_range5.tpl Data Auxiliary data
  Accessible without login HTML file global.html Doc. Documentation
  Accessible without login Plain text file global.php Test Unit test script
  Accessible without login Plain text file global.tpl Data Auxiliary data
  Accessible without login Plain text file ifchanged.html Data Template file
  Accessible without login Plain text file ifchanged.php Data Testing file
  Accessible without login Plain text file ifchanged.tpl Data Testing file
  Accessible without login Plain text file ifequals.html Data Testing file
  Accessible without login Plain text file ifequals.tpl Data Testing file
  Accessible without login Plain text file if_else_simple.html Data Testing file
  Accessible without login Plain text file if_else_simple.php Data Testing file
  Accessible without login Plain text file if_else_simple.tpl Data Testing file
  Accessible without login Plain text file in.html Data Testing file
  Accessible without login Plain text file in.php Data Testing file
  Accessible without login Plain text file in.tpl Data Testing file
  Accessible without login Plain text file inheritence_nested_block.html Data Testing file
  Accessible without login Plain text file inheritence_nested_block.tpl Data Testing file
  Accessible without login Plain text file inheritence_nested_block_duplicated.html Data Testing data
  Accessible without login Plain text file inheritence_nested_block_duplicated.tpl Data Testing file
  Accessible without login HTML file inline.html Doc. Documentation
  Accessible without login Plain text file inline.tpl Data Auxiliary data
  Accessible without login Plain text file inline_buffer.tpl Data Auxiliary data
  Accessible without login HTML file intval.html Doc. Documentation
  Accessible without login Plain text file intval.php Test
  Accessible without login Plain text file intval.tpl Data Auxiliary data
  Accessible without login Plain text file join.html Data Testing data
  Accessible without login Plain text file join.php Aux. Testing file
  Accessible without login Plain text file join.tpl Data Testing file
  Accessible without login Plain text file load.html Data Testing file
  Accessible without login Plain text file load.php Data Testing file
  Accessible without login Plain text file load.tpl Data Testing data
  Accessible without login Plain text file loop.html Data Testing file
  Accessible without login Plain text file loop.php Data Testing file
  Accessible without login Plain text file loop.tpl Data Testing file
  Accessible without login HTML file loop_object.html Doc. Documentation
  Accessible without login Plain text file loop_object.php Test Unit test script
  Accessible without login Plain text file loop_object.tpl Data Auxiliary data
  Accessible without login HTML file method.html Doc. Documentation
  Accessible without login Plain text file method.php Test Unit test script
  Accessible without login Plain text file method.tpl Data Auxiliary data
  Accessible without login Plain text file nested_block.html Data Testing file
  Accessible without login Plain text file nested_block.tpl Data Testing file
  Accessible without login Plain text file nested_block_second_parent.html Data Testing file
  Accessible without login Plain text file nested_block_second_parent.tpl Data Testing file
  Accessible without login Plain text file nested_block_second_parent_override.html Data Testing file
  Accessible without login Plain text file nested_block_second_parent_override.tpl Data Testing file
  Accessible without login HTML file null.html Doc. Documentation
  Accessible without login Plain text file null.php Test Unit test script
  Accessible without login Plain text file null.tpl Data Auxiliary data
  Accessible without login HTML file object.html Doc. Documentation
  Accessible without login Plain text file object.php Test Unit test script
  Accessible without login Plain text file object.tpl Data Auxiliary data
  Accessible without login Plain text file partial.tpl Data Testing file
  Accessible without login Plain text file pluralize.html Data Testing data
  Accessible without login Plain text file pluralize.php Data Testinf file
  Accessible without login Plain text file pluralize.tpl Data Testing file
  Accessible without login Plain text file regroup.html Data Testing file
  Accessible without login Plain text file regroup.php Data Testing file
  Accessible without login Plain text file regroup.tpl Data Testing file
  Accessible without login HTML file set.html Doc. Documentation
  Accessible without login Plain text file set.tpl Data Auxiliary data
  Accessible without login Plain text file spaceless.html Data Testing file
  Accessible without login Plain text file spaceless.tpl Data Testing file
  Accessible without login HTML file strip_whitespace.html Doc. Documentation
  Accessible without login Plain text file strip_whitespace.tpl Data Auxiliary data
  Accessible without login Plain text file subtemplate.html Data Testing file
  Accessible without login Plain text file subtemplate.php Data Testing file
  Accessible without login Plain text file subtemplate.tpl Data Testing file
  Accessible without login Plain text file sub_set.tpl Data Auxiliary data
  Accessible without login Plain text file templatetag.html Data Testing file
  Accessible without login Plain text file templatetag.tpl Data Testing file
  Accessible without login Plain text file title.html Data Testing file
  Accessible without login Plain text file title.php Data Testing data
  Accessible without login Plain text file title.tpl Data Testing file
  Accessible without login HTML file trans.html Doc. Documentation
  Accessible without login Plain text file trans.php Test Unit test script
  Accessible without login Plain text file trans.tpl Data Auxiliary data
  Accessible without login Plain text file truncatewords.html Data Testing file
  Accessible without login Plain text file truncatewords.php Data Testing file
  Accessible without login Plain text file truncatewords.tpl Data Testing file
  Accessible without login HTML file try_include.html Doc. Documentation
  Accessible without login Plain text file try_include.tpl Data Auxiliary data
  Accessible without login HTML file variable_existe.html Doc. Documentation
  Accessible without login Plain text file variable_existe.tpl Data Auxiliary data
  Accessible without login Plain text file with.html Data Testing file
  Accessible without login Plain text file with.php Data Testing file
  Accessible without login Plain text file with.tpl Data Template file

  Files folder image Files  /  tests  /  assert_templates  /  locale  
File Role Description
Files folder imagees_ES (1 directory)

  Files folder image Files  /  tests  /  assert_templates  /  locale  /  es_ES  
File Role Description
Files folder imageLC_MESSAGES (1 file)

  Files folder image Files  /  tests  /  assert_templates  /  locale  /  es_ES  /  LC_MESSAGES  
File Role Description
  Accessible without login Plain text file messages.po Data Auxiliary data

  Files folder image Files  /  tests  /  err_templates  
File Role Description
  Accessible without login Plain text file block.tpl Data Template for testing
  Accessible without login Plain text file block_nonparent.tpl Data Template for testing
  Accessible without login Plain text file block_super.tpl Data Template for testing
  Accessible without login Plain text file block_super_filter.tpl Data Template for testing
  Accessible without login Plain text file block_super_nonsubtemplate.tpl Data Template for testing
  Accessible without login Plain text file dictsort.tpl Data Template for testing
  Accessible without login Plain text file dictsort1.tpl Data Template for testing
  Accessible without login Plain text file dictsort2.tpl Data Template for testing
  Accessible without login Plain text file err_block_super.tpl Data Auxiliary data
  Accessible without login Plain text file err_block_super_filter.tpl Data Auxiliary data
  Accessible without login Plain text file err_block_super_nonsubtemplate.tpl Data Auxiliary data
  Accessible without login Plain text file err_dictsort.tpl Data Auxiliary data
  Accessible without login Plain text file err_dictsort1.tpl Data Auxiliary data
  Accessible without login Plain text file err_dictsort2.tpl Data Auxiliary data
  Accessible without login Plain text file err_invalid_tryinclude.tpl Data Auxiliary data
  Accessible without login Plain text file err_load1.tpl Data Auxiliary data
  Accessible without login Plain text file err_load2.tpl Data Auxiliary data
  Accessible without login Plain text file exec_notallowed.tpl Data Auxiliary data
  Accessible without login Plain text file forloop.tpl Data Template for testing
  Accessible without login Plain text file forloop1.tpl Data Template for testing
  Accessible without login Plain text file ifchanged.tpl Data Template for testing
  Accessible without login Plain text file inline1.tpl Data Auxiliary data
  Accessible without login Plain text file inline2.tpl Data Auxiliary data
  Accessible without login Plain text file inline3.tpl Data Auxiliary data
  Accessible without login Plain text file inline4.tpl Data Auxiliary data
  Accessible without login Plain text file inline5.tpl Data Auxiliary data
  Accessible without login Plain text file invalid_blockname.tpl Data Template for testing
  Accessible without login Plain text file loop_varname.tpl Data Template for testing
  Accessible without login Plain text file pluralize.tpl Data Template for testing
  Accessible without login Plain text file reverse.tpl Data Template for testing
  Accessible without login Plain text file templatetag1.tpl Data Template for testing
  Accessible without login Plain text file templatetag2.tpl Data Template for testing
  Accessible without login Plain text file templatetag3.tpl Data Template for testing
  Accessible without login Plain text file title.tpl Data Template for testing
  Accessible without login Plain text file tokenizer_1.tpl Data Auxiliary data
  Accessible without login Plain text file tokenizer_2.tpl Data Auxiliary data
  Accessible without login Plain text file tokenizer_3.tpl Data Auxiliary data
  Accessible without login Plain text file tokenizer_4.tpl Data Auxiliary data
  Accessible without login Plain text file tokenizer_5.tpl Data Auxiliary data

  Files folder image Files  /  tests  /  tmp  
File Role Description
  Accessible without login Plain text file .dummy Data Dumy file to create tmp folder

 Version Control Unique User Downloads Download Rankings  
 94%Total:330All time:6,345
 This week:0This week:1,508Up