Example #1
0
 protected function _createFromReflection($reflection)
 {
     $this->_name = pathinfo($reflection->getFileName(), PATHINFO_FILENAME);
     parent::_createFromReflection($reflection);
     foreach ($reflection->getMethods() as $method) {
         if ($method->getDeclaringClass()->getName() == $reflection->getName()) {
             $this->addMethod(ControllerMethod::create($this, $method));
         }
     }
     $layoutPath = \Path::instance()->evaluate(':' . $this->project()->name() . ".apps.layout.+{$this->name()}.@layout.php");
     //Application Layout
     $paramsPath = \Path::instance()->evaluate(':' . $this->project()->name() . ".apps.layout.+{$this->name()}.@params.php");
     //Application Params
     $viewPath = \Path::instance()->evaluate(':' . $this->project()->name() . ".apps.view.+{$this->name()}.@view.php");
     //Application View
     if (file_exists($layoutPath)) {
         $this->_layout = Layout::create($layoutPath);
     }
     if (file_exists($paramsPath)) {
         $this->_params = Params::create($paramsPath);
     }
     if (file_exists($viewPath)) {
         $this->_view = ControllerAppView::create($this);
     }
 }
Example #2
0
 protected function _createFromReflection($reflection)
 {
     $_parts = explode('Abstractor', $reflection->getName());
     $this->_name = $_parts[0];
     parent::_createFromReflection($reflection);
     foreach ($reflection->getMethods() as $method) {
         if ($method->getDeclaringClass()->getName() == $reflection->getName()) {
             $this->addMethod(SpiritMethod::create($this, $method));
         }
     }
     $interfaces = $reflection->getInterfaceNames();
     foreach ($interfaces as $interface) {
         switch (true) {
             case preg_match('~Bound$~', $interface) > 0:
                 $this->_binding = $interface;
                 break;
             case preg_match('~XDO$~', $interface) > 0:
                 $this->_serialization = $interface;
                 break;
             case preg_match('~Feeded$~', $interface) > 0:
                 $this->_feeder = $interface;
                 break;
             case preg_match('~Spirit$~', $interface) > 0:
                 $this->_session = $interface;
                 break;
         }
     }
 }
Example #3
0
 protected function _createFromReflection($reflection)
 {
     $_parts = explode('Abstractor', $reflection->getName());
     $this->_name = $_parts[0];
     parent::_createFromReflection($reflection);
 }
Example #4
0
 protected function _createFromReflection($reflection)
 {
     $this->_name = pathinfo($reflection->getFileName(), PATHINFO_FILENAME);
     parent::_createFromReflection($reflection);
 }