예제 #1
0
 public function generateConstructor($code)
 {
   parent::generateConstructor($code);
   if (array_key_exists('hide', $this->attributes))
   {
     $code->writePhp($this->getComponentRefCode() . '->visible = false;');
   }
 }
예제 #2
0
  public function generateConstructor($code)
  {
    parent::generateConstructor($code);

    if (array_key_exists('items', $this->attributes))
    {
      $code->writePhp($this->getComponentRefCode() . '->items = \'' . $this->attributes['items'] . '\';');
    unset($this->attributes['items']);
    }
    if (array_key_exists('pages_per_section', $this->attributes))
    {
      $code->writePhp($this->getComponentRefCode() . '->pages_per_section = \'' . $this->attributes['pages_per_section'] . '\';');
    unset($this->attributes['pages_per_section']);
    }
  }
  function generateConstructor(&$code)
  {
    parent :: generateConstructor($code);

    $items = $this->getAttribute('items');
    if (!empty($items))
      $code->writePhp($this->getComponentRefCode() . '->setItemsPerPage(' . $items . ');');

    $pages_per_section = $this->getAttribute('pages_per_section');
    if (!empty($pages_per_section))
      $code->writePhp($this->getComponentRefCode() . '->setPagesPerSection(' . $pages_per_section . ');');

    $pager_prefix = $this->getAttribute('pager_prefix');
    if (!empty($pager_prefix))
      $code->writePhp($this->getComponentRefCode() . '->setPagerPrefix("' . $pager_prefix . '");');
  }
 /**
 * Writes the compiled template constructor from the runtime component,
 * assigning the attributes found at compile time to the runtime component
 * via a serialized string
 */
 public function generateConstructor($code)
 {
   parent::generateConstructor($code);
   $code->writePhp($this->getComponentRefCode() . '->attributes = ' . var_export($this->attributes, true) . ';');
 }