コード例 #1
0
 /**
  * Loads the generator with the specified ID.
  * @param  string                $id the ID of the generator to be loaded.
  * @return \yii\gii\Generator    the loaded generator
  * @throws NotFoundHttpException
  */
 protected function loadGenerator($id)
 {
     if (isset($this->module->generators[$id])) {
         $this->generator = $this->module->generators[$id];
         $this->generator->loadStickyAttributes();
         $this->generator->load($_POST);
         return $this->generator;
     } else {
         throw new NotFoundHttpException("Code generator not found: {$id}");
     }
 }