Example #1
0
 public static function view()
 {
     $param = config::param();
     $arr = System\Directory::explode($param['0']);
     if (empty($arr[0]) || empty($arr[1]) || empty($arr[2])) {
         return " module name is null;Enter module/view_dir/html_name]\n";
     }
     $file_path = config::app_path() . '/' . $arr[0] . '/View/' . $arr[1] . '/' . $arr[2];
     if (!is_dir(dirname($file_path))) {
         mkdir(dirname($file_path), 0755, true);
     }
     file_put_contents($file_path, 'εˆ›ε»ΊζˆεŠŸ');
 }
Example #2
0
 public static function buildBehaviors($module, $controller)
 {
     $tempPath = config::get('behaviors_path');
     $file = config::app_path() . '/' . $module . '/behaviors/' . $controller . '.php';
     if (!is_file($file)) {
         $content = file_get_contents($tempPath);
         $content = str_replace(array('[MODULE]', '[CONTROLLER]'), array($module, $controller), $content);
         if (false) {
             $content = preg_replace('/namespace\\s(.*?);/', '', $content, 1);
         }
         $dir = dirname($file);
         if (!is_dir($dir)) {
             mkdir($dir, 0755, true);
         }
         file_put_contents($file, $content);
     }
 }