Skip to content

ffic/ogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ogo

PHP HMVC framework.

Require the "_init.php" file and start to enjoy.

EXAMPLE:

require "_init.php";

$app = \ogo\App::create();

$app->add_route(
	"get post put delete", 
	"/[:module]/[:action]", 
	function ($request, $params) use ($app) {
		try {
			$response = $app->call(
				"APP.modules.{$params["module"]}", 
				$params["action"], 
				$request->get_data()
			);
			$response->set_type("json");
			return $response;
		}
		catch (\ogo\Exception $e) {
			$response = new \ogo\Response("error");
			$response->set_type("json");
			$response->set_data($e->get_message());
		}
		return $response;
	}
);

$app->def(function ($request) use ($app) {
	$app->redirect("/welcome/index");
});

// RUN
$response = $app->run();
$response->render();

About

PHP framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages