示例#1
0
 public function load(\Transphporm\Config $config)
 {
     $locale = $this->getLocale();
     $config->registerFormatter(new \Transphporm\Formatter\Number($locale));
     $config->registerFormatter(new \Transphporm\Formatter\Date($locale));
     $config->registerFormatter(new \Transphporm\Formatter\StringFormatter());
     $config->registerFormatter(new \Transphporm\Formatter\Nl2br());
 }
示例#2
0
 public function load(\Transphporm\Config $config)
 {
     if (!isset($_SESSION['messages'])) {
         $_SESSION['messages'] = [];
     }
     $headers =& $config->getHeaders();
     $functionSet = $config->getFunctionSet();
     $config->registerProperty('message', new Message());
     $functionSet->addFunction('messages', new Messages($headers));
 }
示例#3
0
 public function load(\Transphporm\Config $config)
 {
     $functionSet = $config->getFunctionSet();
     $baseDir = $config->getFilePath();
     $functionSet->addFunction('attr', new \Transphporm\TSSFunction\Attr());
     $functionSet->addFunction('data', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'data'));
     $functionSet->addFunction('root', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'root'));
     $functionSet->addFunction('key', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'key'));
     $functionSet->addFunction('iteration', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'iteration'));
     $templateFunction = new \Transphporm\TSSFunction\Template($config->getElementData(), $config->getCssToXpath(), $baseDir);
     $functionSet->addFunction('template', $templateFunction);
     $functionSet->addFunction('json', new \Transphporm\TSSFunction\Json($baseDir));
     // Register HTML formatter here because it uses the template function
     $config->registerFormatter(new \Transphporm\Formatter\HTMLFormatter($templateFunction));
 }
示例#4
0
 public function load(\Transphporm\Config $config)
 {
     $data = $config->getFunctionSet();
     $headers =& $config->getHeaders();
     $config->registerProperty('content', new \Transphporm\Property\Content($headers, $config->getFormatter()));
     $config->registerProperty('repeat', new \Transphporm\Property\Repeat($data, $config->getElementData(), $config->getLine()));
     $config->registerProperty('display', new \Transphporm\Property\Display());
     $config->registerProperty('bind', new \Transphporm\Property\Bind($config->getElementData()));
 }
示例#5
0
 public function load(\Transphporm\Config $config)
 {
     $config->registerFormatter(new ReverseFormatter());
 }
示例#6
0
 public function load(\Transphporm\Config $config)
 {
     $config->registerPseudo(new \Transphporm\Pseudo\Attribute());
     $config->registerPseudo(new \Transphporm\Pseudo\Nth());
     $config->registerPseudo(new \Transphporm\Pseudo\Not($config->getCssToXpath()));
 }