pclib  2.9.5
Lightweight PHP framework
Template tags implemented by class Tpl
  • class
    • use "modules" comma separated list of modules loaded into template from $app->globals service
  • block
    • repeat "n" - print block n-times, reading data from array of n-rows.
  • number - Print numeric value
    • format "dpt" - (d)ecimal, dec(p)oint, (t)housand separator
      • Example: format "2.," will print number 1234.1234 as "1,234.12"
      • Example: format "1, " will print number 1234.1234 as "1 234,1" see php function numeric_format()
  • string - Print string value
    • size "n" - Cut string to length n characters
    • format "nhHulsf"
      • n convert end of line to
      • h escape html tags
      • H strip html tags
      • u uppercase
      • l lovercase
      • s addslashes
      • f convert to canonical filename string
    • endian "str" - Add endian string "str", if string is longer than size "n"
    • tooltip - Show full length string as tooltip (on mouseover)
    • date ["fmt"] - Format database date. Default is "%d. %m. %Y" see php function strftime() for other possible formating
    • loop "value1,value2,..." will cycle values in repeating block
  • bind - Print lookup value
    • list | query | lookup - Datasource - see Common attributes of template tags
    • field "field" - Uses field "field" as binding source
    • bitfield - Bind to bitfield value. Show comma separated list of labels.
    • emptylb "label" - This label is shown, if no binding value is found Useful for showing checkbox arrays stored in database.
  • action - insert controller's action result into template
    • route "route" - Path to controller's action
  • include - include template into current template and merge elements of included template
    • file "path" - Path to included template
  • link
    • lb "label" - Label of the link
    • href "url" - Url of the link
    • route "route" - Instead of href, you can use route. See PClib route.
    • popup ["params"] Open link in popup window. If "params" are present, they specify size, position and window features in that order. Ex: popup "800x600", popup "800x600+500+300" (A "+x+y" are window position coordinates), popup "800x600 none" (All window features are disabled. Possible values are: none,min,max,full).
    • img "path/to/image" - Make link from image
    • confirm "question" - Show javascript confirm dialog with "question"

      For the link, you can use following tag modificators:

      • {link.url} Return link url
      • {link.js} Generate javascript redirect to link url

      (*) Note that in both attributes - route and href - you can place any template tag value since 1.5.0. Ex: href "company.php?id={ID}"