public static function view($app, $controller = null, $view = null) { self::try_define('APP', $app); if (!$controller) { $controller = moojon_config::get('default_controller'); } self::try_define('CONTROLLER', $controller); if (!$view) { $view = moojon_config::get('default_action'); } moojon_files::attempt_mkdir(moojon_paths::get_project_views_directory()); moojon_files::attempt_mkdir(moojon_paths::get_project_views_app_directory(APP)); moojon_files::attempt_mkdir(moojon_paths::get_project_views_app_controller_directory(APP, CONTROLLER)); self::run(moojon_paths::get_moojon_templates_directory() . 'view.template', moojon_paths::get_project_views_app_controller_directory(APP, CONTROLLER) . "{$view}.view.php", array(), false, true); }
public static function get_actions() { $data = self::get_data(); require_once moojon_paths::get_controller_path($data['app'], $data['controller']); $actions = get_class_methods(self::get_controller_class($data['controller'])); $paths = array(moojon_paths::get_moojon_views_directory(), moojon_paths::get_moojon_views_app_directory(moojon_uri::get_app()), moojon_paths::get_moojon_views_app_controller_directory(moojon_uri::get_app(), moojon_uri::get_controller()), moojon_paths::get_project_views_directory(), moojon_paths::get_project_views_app_directory(moojon_uri::get_app()), moojon_paths::get_project_views_app_controller_directory(moojon_uri::get_app(), moojon_uri::get_controller())); foreach (self::colate_view($paths) as $view) { if (!in_array($actions, $view)) { $actions[] = $view; } } return $actions; }