PHP Classes

PHP Custom Tags: Template engine based on tags similar to HTML

Recommend this page to a friend!
  Info   View files View files (137)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 308 This week: 3All time: 7,323 This week: 141Up
Version License PHP version Categories
custom-tags 10BSD License5.1HTML, PHP 5, Templates
Description 

Author

This class implements a template engine based on tags similar to HTML.

It can capture and process the current script output as a template that may have tags similar to HTML.

The supported tags behavior is defined according to the presence of directories with the same name of the tag inside a given tag directory.

Each tag directory can contain templates and scripts that define how each tag should be processed.

Picture of Oliver Lillie
  Performance   Level  
Name: Oliver Lillie <contact>
Classes: 4 packages by
Country: Finland Finland
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Details

#PHP CustomTags Allows you to create HTML custom tags that aids in templating and providing easy to use extendable functionality that designers find easy to work with. Create completely customisable tags and even comes with a simple internal templating engine. Tags can also be collected and processed in bulk, which can be usefull when optimising performance of database queries and other such junk. ##An Example Custom Tag. ```html <ct:inline some="attribute"> This is an in line template. <br /> This is a #{tag} that can be accessed by the callback function </ct:inline>` ``` ##Simple Integrated Example ```php <?php $current_dir = dirname(__FILE__).DIRECTORY_SEPARATOR; require_once dirname($current_dir).DIRECTORY_SEPARATOR.'customtags.php'; $ct = new CustomTags(array( 'parse_on_shutdown' => true, 'tag_directory' => $current_dir.'tags'.DIRECTORY_SEPARATOR, 'sniff_for_buried_tags' => true )); ?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>untitled</title> <meta name="generator" content="TextMate http://macromates.com/"> <meta name="author" content="Oliver Lillie"> <!-- Date: 2010-07-10 --> </head> <body> <ct:youtube id="wfI0Z6YJhL0" /> </body> </html> ``` **Inside the related tag file; tags/youtube/tag.php:** ```php <?php function ct_youtube($tag) { return '<object id="'.$tag['attributes']->id.'" value="http://www.youtube.com/v/'.$tag['attributes']->id.'" /><param ...etc...>'; } ```` **Resulting output:** ```html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>untitled</title> <meta name="generator" content="TextMate http://macromates.com/"> <meta name="author" content="Oliver Lillie"> <!-- Date: 2010-07-10 --> </head> <body> <object id="wfI0Z6YJhL0" value="http://www.youtube.com/v/wfI0Z6YJhL0" /><param ...etc...> </body> </html> ```

  Files folder image Files  
File Role Description
Files folder imageexamples (5 files, 1 directory)
Files folder imagelib (1 directory)
Accessible without login Plain text file autoloader.php Aux. .
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data .
Accessible without login Plain text file LICENSE.md Lic. Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data

  Files folder image Files  /  examples  
File Role Description
Files folder imagetags (9 directories)
  Accessible without login Plain text file example01.php Example Example script
  Accessible without login Plain text file example02.php Example Example script
  Accessible without login Plain text file example03.php Example Example script
  Accessible without login Plain text file example04.php Example Example script
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  examples  /  tags  
File Role Description
Files folder imageadvert (1 file, 1 directory)
Files folder imageanalytics (1 file, 1 directory)
Files folder imagedate (1 file)
Files folder imageentities (1 file)
Files folder imageheader (1 file)
Files folder imagelower (1 file)
Files folder imagesearch-highlight (1 file)
Files folder imagesyntax (1 file, 1 directory)
Files folder imageupper (1 file)

  Files folder image Files  /  examples  /  tags  /  advert  
File Role Description
Files folder imagetemplates (2 files)
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  advert  /  templates  
File Role Description
  Accessible without login Plain text file banner.html Data Auxiliary data
  Accessible without login Plain text file mpu.html Data Documentation

  Files folder image Files  /  examples  /  tags  /  analytics  
File Role Description
Files folder imagetemplates (1 file)
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  analytics  /  templates  
File Role Description
  Accessible without login Plain text file google.html Data Documentation

  Files folder image Files  /  examples  /  tags  /  date  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  entities  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  header  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  lower  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  search-highlight  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  syntax  
File Role Description
Files folder imagegeshi (1 file, 2 directories)
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  examples  /  tags  /  syntax  /  geshi  
File Role Description
Files folder imagecontrib (4 files)
Files folder imagegeshi (109 files)
  Accessible without login Plain text file geshi.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  tags  /  syntax  /  geshi  /  contrib  
File Role Description
  Accessible without login Plain text file aliased.php Aux. Auxiliary script
  Accessible without login Plain text file cssgen.php Aux. Auxiliary script
  Accessible without login Plain text file example.php Aux. Auxiliary script
  Accessible without login Plain text file langcheck.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  tags  /  syntax  /  geshi  /  geshi  
File Role Description
  Accessible without login Plain text file abap.php Aux. Auxiliary script
  Accessible without login Plain text file actionscript.php Aux. Auxiliary script
  Accessible without login Plain text file actionscript3.php Aux. Auxiliary script
  Accessible without login Plain text file ada.php Aux. Auxiliary script
  Accessible without login Plain text file apache.php Aux. Auxiliary script
  Accessible without login Plain text file applescript.php Aux. Auxiliary script
  Accessible without login Plain text file apt_sources.php Aux. Auxiliary script
  Accessible without login Plain text file asm.php Aux. Auxiliary script
  Accessible without login Plain text file asp.php Aux. Auxiliary script
  Accessible without login Plain text file autoit.php Aux. Auxiliary script
  Accessible without login Plain text file bash.php Aux. Auxiliary script
  Accessible without login Plain text file basic4gl.php Aux. Auxiliary script
  Accessible without login Plain text file blitzbasic.php Aux. Auxiliary script
  Accessible without login Plain text file bnf.php Aux. Auxiliary script
  Accessible without login Plain text file boo.php Aux. Auxiliary script
  Accessible without login Plain text file c.php Aux. Auxiliary script
  Accessible without login Plain text file caddcl.php Aux. Auxiliary script
  Accessible without login Plain text file cadlisp.php Aux. Auxiliary script
  Accessible without login Plain text file cfdg.php Aux. Auxiliary script
  Accessible without login Plain text file cfm.php Aux. Auxiliary script
  Accessible without login Plain text file cil.php Aux. Auxiliary script
  Accessible without login Plain text file cobol.php Aux. Auxiliary script
  Accessible without login Plain text file cpp-qt.php Aux. Auxiliary script
  Accessible without login Plain text file cpp.php Aux. Auxiliary script
  Accessible without login Plain text file csharp.php Aux. Auxiliary script
  Accessible without login Plain text file css.php Aux. Auxiliary script
  Accessible without login Plain text file c_mac.php Aux. Auxiliary script
  Accessible without login Plain text file d.php Aux. Auxiliary script
  Accessible without login Plain text file delphi.php Aux. Auxiliary script
  Accessible without login Plain text file diff.php Aux. Auxiliary script
  Accessible without login Plain text file div.php Aux. Auxiliary script
  Accessible without login Plain text file dos.php Aux. Auxiliary script
  Accessible without login Plain text file dot.php Aux. Auxiliary script
  Accessible without login Plain text file eiffel.php Aux. Auxiliary script
  Accessible without login Plain text file fortran.php Aux. Auxiliary script
  Accessible without login Plain text file freebasic.php Aux. Auxiliary script
  Accessible without login Plain text file genero.php Aux. Auxiliary script
  Accessible without login Plain text file gettext.php Aux. Auxiliary script
  Accessible without login Plain text file glsl.php Aux. Auxiliary script
  Accessible without login Plain text file gml.php Aux. Auxiliary script
  Accessible without login Plain text file gnuplot.php Aux. Auxiliary script
  Accessible without login Plain text file groovy.php Aux. Auxiliary script
  Accessible without login Plain text file haskell.php Aux. Auxiliary script
  Accessible without login Plain text file html4strict.php Aux. Auxiliary script
  Accessible without login Plain text file idl.php Aux. Auxiliary script
  Accessible without login Plain text file ini.php Aux. Auxiliary script
  Accessible without login Plain text file inno.php Aux. Auxiliary script
  Accessible without login Plain text file io.php Aux. Auxiliary script
  Accessible without login Plain text file java.php Aux. Auxiliary script
  Accessible without login Plain text file java5.php Aux. Auxiliary script
  Accessible without login Plain text file javascript.php Aux. Auxiliary script
  Accessible without login Plain text file kixtart.php Aux. Auxiliary script
  Accessible without login Plain text file klonec.php Aux. Auxiliary script
  Accessible without login Plain text file klonecpp.php Aux. Auxiliary script
  Accessible without login Plain text file latex.php Aux. Auxiliary script
  Accessible without login Plain text file lisp.php Aux. Auxiliary script
  Accessible without login Plain text file lotusformulas.php Aux. Auxiliary script
  Accessible without login Plain text file lotusscript.php Aux. Auxiliary script
  Accessible without login Plain text file lua.php Aux. Auxiliary script
  Accessible without login Plain text file m68k.php Aux. Auxiliary script
  Accessible without login Plain text file matlab.php Aux. Auxiliary script
  Accessible without login Plain text file mirc.php Aux. Auxiliary script
  Accessible without login Plain text file mpasm.php Aux. Auxiliary script
  Accessible without login Plain text file mxml.php Aux. Auxiliary script
  Accessible without login Plain text file mysql.php Aux. Auxiliary script
  Accessible without login Plain text file nsis.php Aux. Auxiliary script
  Accessible without login Plain text file objc.php Aux. Auxiliary script
  Accessible without login Plain text file ocaml-brief.php Aux. Auxiliary script
  Accessible without login Plain text file ocaml.php Aux. Auxiliary script
  Accessible without login Plain text file oobas.php Aux. Auxiliary script
  Accessible without login Plain text file oracle8.php Aux. Auxiliary script
  Accessible without login Plain text file pascal.php Aux. Auxiliary script
  Accessible without login Plain text file per.php Aux. Auxiliary script
  Accessible without login Plain text file perl.php Aux. Auxiliary script
  Accessible without login Plain text file php-brief.php Aux. Auxiliary script
  Accessible without login Plain text file php.php Aux. Auxiliary script
  Accessible without login Plain text file pic16.php Aux. Auxiliary script
  Accessible without login Plain text file plsql.php Aux. Auxiliary script
  Accessible without login Plain text file povray.php Aux. Auxiliary script
  Accessible without login Plain text file powershell.php Aux. Auxiliary script
  Accessible without login Plain text file progress.php Aux. Auxiliary script
  Accessible without login Plain text file python.php Aux. Auxiliary script
  Accessible without login Plain text file qbasic.php Aux. Auxiliary script
  Accessible without login Plain text file rails.php Aux. Auxiliary script
  Accessible without login Plain text file reg.php Aux. Auxiliary script
  Accessible without login Plain text file robots.php Aux. Auxiliary script
  Accessible without login Plain text file ruby.php Aux. Auxiliary script
  Accessible without login Plain text file sas.php Aux. Auxiliary script
  Accessible without login Plain text file scala.php Aux. Auxiliary script
  Accessible without login Plain text file scheme.php Aux. Auxiliary script
  Accessible without login Plain text file sdlbasic.php Aux. Auxiliary script
  Accessible without login Plain text file smalltalk.php Aux. Auxiliary script
  Accessible without login Plain text file smarty.php Aux. Auxiliary script
  Accessible without login Plain text file sql.php Aux. Auxiliary script
  Accessible without login Plain text file tcl.php Aux. Auxiliary script
  Accessible without login Plain text file text.php Aux. Auxiliary script
  Accessible without login Plain text file thinbasic.php Aux. Auxiliary script
  Accessible without login Plain text file tsql.php Aux. Auxiliary script
  Accessible without login Plain text file typoscript.php Aux. Auxiliary script
  Accessible without login Plain text file vb.php Aux. Auxiliary script
  Accessible without login Plain text file vbnet.php Aux. Auxiliary script
  Accessible without login Plain text file verilog.php Aux. Auxiliary script
  Accessible without login Plain text file vhdl.php Aux. Auxiliary script
  Accessible without login Plain text file visualfoxpro.php Aux. Auxiliary script
  Accessible without login Plain text file winbatch.php Aux. Auxiliary script
  Accessible without login Plain text file xml.php Aux. Auxiliary script
  Accessible without login Plain text file xorg_conf.php Aux. Auxiliary script
  Accessible without login Plain text file xpp.php Aux. Auxiliary script
  Accessible without login Plain text file z80.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  tags  /  upper  
File Role Description
  Accessible without login Plain text file tag.php Aux. Example script

  Files folder image Files  /  lib  
File Role Description
Files folder imageCustomTags (1 file)

  Files folder image Files  /  lib  /  CustomTags  
File Role Description
  Accessible without login Plain text file CustomTags.php Class .

 Version Control Unique User Downloads Download Rankings  
 100%
Total:308
This week:3
All time:7,323
This week:141Up