Orion PHP  0.11.12
The PHP5.3 framework
Orion\Core\Context Class Reference

List of all members.

Static Public Member Functions

static init ($path)
static redirect ($url)
static genURL ($page)
static genModuleURL ($module, $uri=null, $mode=null)
static getAbsoluteURL ($relativeURL)
static getBaseURL ()
static getDefaultTemplate ()
static getDefaultModeExtension ()
static getRelativeURI ()
static getModuleURI ()
static getFullURI ()
static getFullURL ()
static getModuleURL ($module=null)
static getGlobalModelPath ($model=null)
static getLibsPath ($file='')
static getLibsAbsolutePath ($file='')
static getModulePath ()
static getModuleAbsolutePath ($file='')
static getPluginPath ($plugin=null)
static getPluginURL ($plugin=null)
static getTemplatePath ($template)
static getUploadRelativeFilePath ($file='')
static getUploadPath ($file='')
static getUploadFilePath ($file='')
static getTemplateAbsolutePath ($template)
static getTemplateFilePath ($template)
static get ($var, $exceptIfNotSet, $preventInjection)
static post ($var, $exceptIfNotSet=false, $preventInjection=false)
static setHeaderCode ($code)

Static Public Attributes

static $URI
static $BASE_DIR
static $PATH
static $MODULE_NAME = null
static $MODULE_EXT = null
static $MODULE_URI = ''
static $MODULE_SEP = '/'

Detailed Description

Orion context class.

Handles static context variables such as URL and requests. Support for URL generation, header definitions and more.

Author:
Thibaut Despoulain BSD 4-clauses
Version:
0.2.11

Definition at line 20 of file context.php.


Member Function Documentation

static Orion\Core\Context::genModuleURL ( module,
uri = null,
mode = null 
) [static]

Generates an absolute module URL from a module name. For example: genModuleURL('home','/page-1','admin'); will generate 'http://mysite.com/pathtoapp/home/page-1.html'

Parameters:
string$moduleExample: home
string$uriExample: /page/1
string$modeExample admin
Returns:
string

Definition at line 184 of file context.php.

static Orion\Core\Context::genURL ( page) [static]

Generates an absolute URL (prevents URL rewrite issues)

Parameters:
stringpage url (ie: home/page-2.html)

Definition at line 171 of file context.php.

static Orion\Core\Context::get ( var,
exceptIfNotSet,
preventInjection 
) [static]

Get a $_GET variable

Parameters:
$varthe variable name
$exceptIfNotSetSet this to TRUE to throw an exception if the variable is not set
$preventInjectionSet this to TRUE to escape variable content to prevent injections

Definition at line 446 of file context.php.

static Orion\Core\Context::getAbsoluteURL ( relativeURL) [static]

Get the absolute URL based on an URL relative to the base URL

Parameters:
StringRelative URL
Returns:
String

Definition at line 206 of file context.php.

static Orion\Core\Context::getBaseURL ( ) [static]

Get Orion's base URL (this is an alias for Orion::config()->get('BASE_URL'))

Returns:
string

Definition at line 223 of file context.php.

static Orion\Core\Context::getDefaultModeExtension ( ) [static]

Get default mode's extension from configuration file

Returns:
string Extension

Definition at line 246 of file context.php.

static Orion\Core\Context::getDefaultTemplate ( ) [static]

Get current mode's default template from configuration

Returns:
string template name

Definition at line 232 of file context.php.

static Orion\Core\Context::getFullURI ( ) [static]

Get current page complete relative URI (ex: 'module/method/params.html')

Returns:
string

Definition at line 277 of file context.php.

static Orion\Core\Context::getFullURL ( ) [static]

Get current page complete absolute URL (ex: 'mysite.com/module/method/params.html')

Returns:
string

Definition at line 289 of file context.php.

static Orion\Core\Context::getGlobalModelPath ( model = null) [static]

Get current module's path (with trailing slash)

Returns:
string

Definition at line 311 of file context.php.

static Orion\Core\Context::getLibsAbsolutePath ( file = '') [static]

Get Orion's absolute lib path or generate a filepath for a libs component.

Parameters:
String$fileoptionnal
Returns:
String

Definition at line 334 of file context.php.

static Orion\Core\Context::getLibsPath ( file = '') [static]

Get Orion's lib path or generate a filepath for a libs component.

Parameters:
String$fileoptionnal
Returns:
String

Definition at line 324 of file context.php.

static Orion\Core\Context::getModuleAbsolutePath ( file = '') [static]

Get current module's absolute path (with trailing slash)

Returns:
string

Definition at line 352 of file context.php.

static Orion\Core\Context::getModulePath ( ) [static]

Get current module's path (with trailing slash)

Returns:
string

Definition at line 343 of file context.php.

static Orion\Core\Context::getModuleURI ( ) [static]

Get current module's relative URI (ex: 'home')

Returns:
string

Definition at line 268 of file context.php.

static Orion\Core\Context::getModuleURL ( module = null) [static]

Get module's complete url

Parameters:
string$moduleModule name, if NULL, returns current module's URL
Returns:
string

Definition at line 299 of file context.php.

static Orion\Core\Context::getPluginPath ( plugin = null) [static]

Get plugin path (with trailing slash)

Parameters:
theplugin folder, if null, returns the global plugins directory path
Returns:
string

Definition at line 362 of file context.php.

static Orion\Core\Context::getPluginURL ( plugin = null) [static]

Get plugin's complete url

Parameters:
string$pluginplugin file, if NULL, returns global plugin url
Returns:
string

Definition at line 375 of file context.php.

static Orion\Core\Context::getRelativeURI ( ) [static]

Get the relative URI (Base URI minus BASE_DIR)

Returns:
string The relative URI

Definition at line 256 of file context.php.

static Orion\Core\Context::getTemplateAbsolutePath ( template) [static]

Get the full path to the provided template folder

Parameters:
string$templateTemplate name
Returns:
string

Definition at line 425 of file context.php.

static Orion\Core\Context::getTemplateFilePath ( template) [static]

Get the full path to the provided template file

Parameters:
string$templateTemplate name
Returns:
string

Definition at line 435 of file context.php.

static Orion\Core\Context::getTemplatePath ( template) [static]

Get the relative path to the provided template folder (with trailing slash)

Parameters:
string$templateTemplate name
Returns:
string

Definition at line 388 of file context.php.

static Orion\Core\Context::getUploadFilePath ( file = '') [static]

Get the absolute path of an uploaded file in the upload_file folder

Parameters:
string$file

Definition at line 415 of file context.php.

static Orion\Core\Context::getUploadPath ( file = '') [static]

Get the absolute path of an uploaded file

Parameters:
string$file

Definition at line 406 of file context.php.

static Orion\Core\Context::getUploadRelativeFilePath ( file = '') [static]

Get the relative path of an uploaded file

Parameters:
string$file

Definition at line 397 of file context.php.

static Orion\Core\Context::init ( path) [static]

Inits Orion's URI context. Basically retreiving and parsing : base directory, requested URI, module URI, URI parameters, and mode.

Throw an Exception if no compatible URI is found.

Definition at line 69 of file context.php.

static Orion\Core\Context::post ( var,
exceptIfNotSet = false,
preventInjection = false 
) [static]

Get a $_POST variable

Parameters:
$varthe variable name
$exceptIfNotSetSet this to TRUE to throw an exception if the variable is not set
$preventInjectionSet this to TRUE to escape variable content to prevent injections

Definition at line 467 of file context.php.

static Orion\Core\Context::redirect ( url) [static]

Write redirect header

Parameters:
mixed$urlEither a redirect code or an URL

Definition at line 143 of file context.php.

static Orion\Core\Context::setHeaderCode ( code) [static]

Write provided status code and corresponding text into output headers. Range of supported code is 100-504.

Parameters:
int$code

Definition at line 487 of file context.php.


Member Data Documentation

Orion::Core\Context::$BASE_DIR [static]

Definition at line 32 of file context.php.

Orion::Core\Context::$MODULE_EXT = null [static]

Definition at line 50 of file context.php.

Orion::Core\Context::$MODULE_NAME = null [static]

Definition at line 44 of file context.php.

Orion::Core\Context::$MODULE_SEP = '/' [static]

Module separator (after module slug and before sub URI)

Definition at line 61 of file context.php.

Orion::Core\Context::$MODULE_URI = '' [static]

Definition at line 56 of file context.php.

Orion::Core\Context::$PATH [static]

Definition at line 38 of file context.php.

Orion::Core\Context::$URI [static]

Definition at line 26 of file context.php.


The documentation for this class was generated from the following file: