示例#1
0
 /**
  *	Handle request
  */
 public function output()
 {
     $mvc = $this->_mvc;
     switch ($mvc['action']) {
         case 'index':
         default:
             $list = $this->_decorator->getAnnounces($mvc['count'], $mvc['limit']);
             break;
     }
     switch ($mvc['view']) {
         case 'index':
         default:
             $this->_converter->setData($list)->setFormat('array')->convertTo('json');
             $this->_converter->output();
             exit;
             break;
     }
 }
示例#2
0
 /**
  *  Create decorated converter
  */
 protected function input()
 {
     /** @var  bConverter__instance $decorConverter */
     $decorConverter = bConverter__instance::create()->setParent($this);
     foreach ($this->_converters as $converter) {
         /** @var bConverter__instance $converter - decor Class */
         $decorConverter = $converter::create()->setParent($this)->decor($decorConverter);
     }
     $this->_converter = $decorConverter;
 }