Shaare your links…
408 links
Liens · Devenet Home Login RSS feed Tags cloud
  • PHP - Extremely light templating system - Stack Overflow → https://stackoverflow.com/questions/4065418/php-extremely-light-templating-system
    /**
    * Renders a single line. Looks for {{ var }}
    *
    * @param string $string
    * @param array $parameters
    *
    * @return string
    */
    function renderString($string, array $parameters)
    {
       $replacer = function ($match) use ($parameters)
       {
           return isset($parameters[$match[1]]) ? $parameters[$match[1]] : $match[0];
       };

       return preg_replace_callback('/{{\s*(.+?)\s*}}/', $replacer, $string);
    }
    Wed Feb 4 17:04:00 2015 – #permalink
    php ressource
Shaarli by sebsauvage
Shaarli-Theme by Nicolas based on idleman theme