Core Defined Constants & Variables
The following PHP constants are available across PHPLucidFrame.
Constant |
Description |
|---|---|
|
Convenience use of |
|
File system path to the application’s directory |
|
URL to the application root, e.g., |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
File system path to the directory |
|
Namespace according to the site directories, for example,
if you have |
|
Web-accessible path to the |
|
The home page URL |
Note
You can also define your own constants in
/inc/constants.phpor/app/inc/constants.php.
PHPLucidFrame has a global object in Javascript – LC. The following Javascript global variables of LC are available to use.
Variable |
Description |
|---|---|
|
URL to the application root. It could also be accessible as |
|
The current URL |
|
The current language code |
|
The sub-directory name if your application is wrapped in. It would be blank if your application is located in the web server document root. |
|
The current route path |
|
The current route path without query string and file name |
|
Namespace according to the site directories, for example,
if you have |
|
The absolute path to the site root including the language code |
You can also extend any global variable from LC by using a hook __script() in /app/helpers/utility_helper.php.
<?php
/**
* This function is a hook to the core utility function _script()
*/
function __script(){
?>
LC.cleanURL = <?php echo (int) _cfg('cleanURL'); ?>;
<?php
}
?>