예제 #1
0
파일: Gii.php 프로젝트: ybluesky/h2o
 /**
  * 选择组合
  * @param $gp
  * @return array
  */
 private function _chooseGroup($gp)
 {
     $oimg = new \H2O\coding\Image();
     $simdir = $oimg->getTplDir() . 'app' . DS . $gp;
     $smch = $this->_readDir($simdir);
     //读取目录
     echo 'Please choose your application group:' . PHP_EOL;
     $i = 1;
     $aptyp = [];
     $input = [];
     foreach ($smch as $k => $p) {
         echo $i . ':' . $k . PHP_EOL;
         $aptyp[$i] = $k;
         $input[] = $i;
         $i++;
     }
     echo "Enter your number:";
     $aptn = $this->_getInputRangVal($input);
     $group = $aptyp[$aptn];
     //对应的应用组合
     $groupath = $smch[$group];
     //对应组合目录
     return ['name' => $group, 'path' => $groupath];
 }