Developer Manuals


A number of constants and properties are made available across PyroCMS.

PHP Constant List

Name Outputs Description
ADDONPATH addons/ The path to third-party addons. After v1.3.0 it outputs addons/default/
APPPATH system/pyrocms/ The path to the application folders.
APPPATH_URI /system/pyrocms/ The path to the application folders but with a leading slash.
BASE_URL http://site.com The equivalent to CodeIgniter's base_url(). Does not change with or without mod_rewrite.
BASE_URI / The relative root.
CURRENT_LANGUAGE en Outputs the two digit language code of the currently selected language.
FCPATH /var/www/site_folder/ The path to index.php
Since v1.3.0    
ADMIN_THEME admin_theme Outputs the slug of the admin theme that is currently in use.
SHARED_ADDONPATH addons/shared_addons/ The path to add-ons that are shared between all sites. Add-ons are also available to the default site in the free version.
SITE_REF default Can be used to find which site is currently running. Cannot be used inside module install or uninstall logic as it will break in multi-site. Use $this->site_ref there for complete compatibility.
UPLOAD_PATH uploads/default/ The path to the current site's uploads. Cannot be used inside module install or uninstall logic as it will break in multi-site. Use $this->upload_path there for complete compatibility.

 

PHP Global Variable List

Name Outputs Description
$this->controller admin, blog, rss, etc The name of the current controller.
$this->method index, create, etc The name of the current method.
$this->module blog The slug of the current module or an empty string if the current page is the dashboard, login, etc.
$this->permissions array A list of modules that the user is allowed to access. If roles are defined for a module it will contain an object of role permissions.
$this->user an object All user information (groups, users, and profiles tables) of the current user or an empty array if not logged in.
Since v1.3.0    
$this->theme_options an object All theme options for the current admin theme. Can be used like $this->theme_options->news_feed. Professional version only.
$this->site_ref default This is available only in a module's details.php file. Elsewhere in your module use SITE_REF
$this->upload_path uploads/default/ This is available only in a module's details.php file. Elsewhere in your module use UPLOAD_PATH

 

JavaScript Global Variable List

Name Outputs Available Description
APPPATH_URI /system/pyrocms/ admin and front-end The path to the system folder
BASE_URI / admin and front-end The relative root.
BASE_URL http://site.com admin The site address. Unaffected by mod_rewrite.
DEFAULT_TITLE Un-named Website admin The site name.
DIALOG_MESSAGE Are you sure you want to delete this? It cannot be undone. admin The delete warning message in the current language. If you add your own message to the button's title attribute it will be used instead.
SITE_URL http://site.com or http://site.com/index.php admin Changes depending on mod_rewrite settings. Identical to CodeIgniter's site_url()
Since v1.3.0      
UPLOAD_PATH uploads/default/ admin The path to the current site's uploaded files.