public function compileWidget(Twig_Compiler $compiler)
 {
     if ($this->getNode('values')->hasNode('datetime')) {
         if ($this->getNodeValue('datetime')) {
             $this->setDateTimepicker(true);
         }
         $this->getNode('values')->removeNode('datetime');
     }
     if ($this->getNode('values')->hasNode('time')) {
         if ($this->getNodeValue('time')) {
             if (!$this->getNode('values')->hasNode('ampm')) {
                 $node = new Twig_Node_Expression_Constant(false, $this->lineno);
                 $name = new Twig_Node_Expression_Name('ampm', $this->lineno);
                 $this->addNode('ampm', $node, $name);
             }
             $this->setTimepicker(true);
         }
         $this->getNode('values')->removeNode('time');
     }
     if ($this->getNode('values')->hasNode('range')) {
         if ($this->getNodeValue('range')) {
             $this->setRangepicker(true);
         }
         $this->getNode('values')->removeNode('range');
     }
     if ($this->getNode('values')->hasNode('inline')) {
         if ($this->getNodeValue('inline')) {
             $this->setInline(true);
         }
         $this->getNode('values')->removeNode('inline');
     }
     //print_r($this->getNode('values'));
     //print_r($this->getAttribute('names'));
     parent::compileWidget($compiler);
 }
Exemplo n.º 2
0
 public function compileWidget(Twig_Compiler $compiler)
 {
     if ($this->getNode('values')->hasNode('inline')) {
         if ($this->getNodeValue('inline')) {
             $this->setInline(true);
         }
     }
     parent::compileWidget($compiler);
 }