Exemplo n.º 1
0
 public function getSvc($name, $id = null)
 {
     $svc = [];
     if (!is_null($id)) {
         $svc = ServiceManager::getInstance($id);
     } else {
         if (!is_null($name)) {
             $svc = ServiceManager::getInstanceByName($name);
         }
     }
     return $svc;
 }
Exemplo n.º 2
0
 public function actionView($name = null, $id = null, $l = 1)
 {
     $params = [];
     $options = [];
     if ($l == 0) {
         $options['layout'] = '//layouts/blank';
     }
     if (!is_null($id)) {
         $params['svc'] = ServiceManager::getInstance($_GET['id']);
     } else {
         if (!is_null($name)) {
             $params['svc'] = ServiceManager::getInstanceByName($_GET['name']);
         }
     }
     if (!isset($params['svc'])) {
         throw new CHttpException(404);
     }
     $params['title'] = $params['svc']['name'];
     $params['id'] = $params['svc']['id'];
     $this->renderForm("SysServiceForm", null, $params, $options);
 }