public static function forge($args, $subfolder) { $default_files = array(array('source' => $subfolder . '/controllers/base.php', 'location' => 'classes/controller/base.php', 'type' => 'controller'), array('source' => $subfolder . '/controllers/admin.php', 'location' => 'classes/controller/admin.php', 'type' => 'controller'), array('source' => $subfolder . '/views/template.php', 'location' => 'views/admin/template.php', 'type' => 'views'), array('source' => 'dashboard.php', 'location' => 'views/admin/dashboard.php', 'type' => 'views'), array('source' => 'login.php', 'location' => 'views/admin/login.php', 'type' => 'views')); foreach ($default_files as $file) { if (!file_exists($content = APPPATH . $file['location'])) { Generate::create($content, file_get_contents(PKGPATH . 'oil/views/' . static::$view_subdir . $file['source']), $file['type']); } } parent::forge($args, $subfolder); }
public static function forge($args, $subfolder) { $default_files = array(array('source' => $subfolder . '/controllers/base.php', 'location' => 'classes/controller/base.php', 'type' => 'controller'), array('source' => $subfolder . '/controllers/admin.php', 'location' => 'classes/controller/admin.php', 'type' => 'controller'), array('source' => '/template.php', 'location' => 'views/admin/template.php', 'type' => 'views'), array('source' => 'dashboard.php', 'location' => 'views/admin/dashboard.php', 'type' => 'views'), array('source' => 'login.php', 'location' => 'views/admin/login.php', 'type' => 'views')); foreach ($default_files as $file) { // check if there's a template in app, and if so, use that if (is_file(APPPATH . 'views/' . static::$view_subdir . $file['source'])) { Generate::create(APPPATH . $file['location'], file_get_contents(APPPATH . 'views/' . static::$view_subdir . $file['source']), $file['type']); } else { Generate::create(APPPATH . $file['location'], file_get_contents(\Package::exists('oil') . 'views/' . static::$view_subdir . $file['source']), $file['type']); } } parent::forge($args, $subfolder); }