Skip to content

Instantly share code, notes, and snippets.

@jmas
Last active January 1, 2016 07:19
Show Gist options
  • Save jmas/8110847 to your computer and use it in GitHub Desktop.
Save jmas/8110847 to your computer and use it in GitHub Desktop.
classes
App.php
Loader.php
Controller.php
Model.php
View.php
app
controllers
PageController.php
UserController.php
AuthController.php
models
Page.php
User.psp
views
layouts
default.php
plugins
PluginName
assets
PluginNamePlugin.php
config.php
assets
app
PluginName
index.php
Assets
moveFolder()
Request
getQuery()
getPost()
getParam()
getFiles()
App
getBaseUrl()
getBasePath()
getAppPath()
getConfig()
run(path)
router = new Router
router.addRoute()
params = router.parse(path)
controllerName = this.getConfig('defaultController', 'page')
if (params.controller)
controllerName = ucfirst(params.controller)
controllerName = controllerName + 'Controller'
actionName = this.getConfig('defaultAction', 'index')
if (params.action)
actionName = ucfirst(params.action)
actionName = actionName + 'Action'
controller = new Controller
try
controller.exec(actionName, params)
catch (Exception e)
Observer.observe('appError', e)
echo e.getMessage()
end()
Router
addRoute(pattern)
addRoutes(routes)
parse(path)
Controller
exec(action, params)
beforeExec(actionName)
afterExec(actionName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment