Web application basic functions.
More...
Web application basic functions.
Very small and simple web application core.
- Version
- 1.0
- Author
- Digger mrdig.nosp@m.ger@.nosp@m.sad-s.nosp@m.yste.nosp@m.ms.ru
- Copyright
- (c) 2015, SAD-Systems
static getAssets |
( |
|
$assetFiles, |
|
|
|
$assetPath = null |
|
) |
| |
|
static |
Returns array of assets obtained from assets-files.
The method loads and combines multiple arrays into one.
- Parameters
-
array | $assetFiles | List of files returns array of data. |
string | $assetPath | (option) Path to find files with data. |
- Returns
- array Merged arrays data.
static getAutoloaderFile |
( |
| ) |
|
|
static |
Returns a file name of currently registred autoloader
- Returns
- string|false Full filename or false
static getConfig |
( |
|
$config, |
|
|
|
$appInfo = false , |
|
|
|
$assetsFiles = null |
|
) |
| |
|
static |
Returns array of parameters loaded from $configFile and include autoloader (if it's set)
- Parameters
-
string | $config | full name of main configuration file |
boolean | $appInfo | Include (or not) application information (option). False by default. |
string | array | $assetsFiles | [basename|list of basenames] of assets configuration file to include (option). Not included by default. |
- Returns
- array
static getRelativeLink |
( |
|
$link | ) |
|
|
static |
Create relative to web root link
- Parameters
-
- Returns
- string
static getUriRootBack |
( |
| ) |
|
|
static |
Gets the URI root path
- Returns
- string
static startApp |
( |
|
$config | ) |
|
|
static |
Start web application
Very simple application router. It makes the following:
- loads application config (and starts autoloader)
- parse input request and define requested Controller and Action
- include the Controller
- define Layout file (from Controller->layout or config['layout'])
- define View file (execute the Controller method which should return the View name, or gets the Action name if the method return nothing )
- include Layout file. The Layout file may include the View file by call: ~~~include $contentFile;~~~
Inside the Layout and View files all configuration options are available as variables
- Parameters
-
string | array | $config | File name or array of params of application configuration. |
Example:
file: index.php
$basedir = dirname(__DIR__);
$configFile = $basedir . '/config/main.php';
require $basedir . '/lib/digger' . '/application/Starter.php';
$cookieLanguageKey = 'language' |
|
static |
Cookie language key (to determine user's selection)
$subTitleSeparator = ' | ' |
|
static |
The documentation for this class was generated from the following file: