Templates: Difference between revisions
adds local help link |
adds a little one-liner for printing out your capture lines if you already have an array of your custom values. |
||
| Line 41: | Line 41: | ||
=== Smarty === | === Smarty === | ||
For PHP programmers, one of the oldest and well-known template systems (aside from building your own using includes) is the [http://smarty.php.net Smarty] system. For a quick overview, see [[wp:Smarty]] There is also a crash course on the Smarty website in addition to the [http://smarty.php.net/manual/en/ documentation] | For PHP programmers, one of the oldest and well-known template systems (aside from building your own using includes) is the [http://smarty.php.net Smarty] system. For a quick overview, see [[wp:Smarty]] There is also a crash course on the Smarty website in addition to the [http://smarty.php.net/manual/en/ documentation] | ||
==== Smarty in CiviCRM ==== | |||
As of Feb. 2016, Civi uses Smarty v2 | |||
Something like this little one-liner can help to generate your Smarty captures if you have a long list of custom variables | |||
<source lang="php"> | |||
php -r 'include ("/var/www/equality-tech.com/www/drupal/sites/all/modules/custom/eqt/eqt.module"); $stack="stats"; $vars = getHaystack($stack); foreach ($vars as $k=>$v) {print "{capture assign=$k}{{$stack}.$k}{/capture}\n";};'; | |||
</source> | |||
=== Drupal === | === Drupal === | ||
Offers a choice of template systems | Offers a choice of template systems | ||