Пример #1
0
 public function &block($a_name)
 {
     if (isset($this->m_block[$a_name])) {
         return $this->m_block[$a_name];
     }
     $file = null;
     $file = ZLoader::_loadFile($a_name, 'view', 'ZView');
     if (!$file || empty($file)) {
         trigger_error('Block ' . $a_name . ' not found.');
     }
     $block = new ZViewBlock($this->getParent(), 'ViewBlock');
     $block->setViewFile($file);
     $this->m_block[$a_name] =& $block;
     return $this->m_block[$a_name];
 }
Пример #2
0
 /**
  * Set ZBlockView instance by name
  * @param string $a_name
  * @param ZViewBlock $a_block
  * @return ZController
  */
 public function &setBlock($a_name, ZViewBlock &$a_block)
 {
     $this->m_block[trim((string) $a_name)] = $a_block->setThis($this);
     return $this;
 }