PHP Класс CroogoComponent

PHP version 5
Автор: Fahad Ibnay Heylaal ([email protected])
Наследование: extends Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$blocksData array Blocks data: contains parsed value of bb-code like strings
$components array Other components used by this component

Защищенные свойства (Protected)

Свойство Тип Описание
$_controller Controller controller
$_defaultRoleId integer Default is 3 (public)

Открытые методы

Метод Описание
__get ( $name ) : Object Method to lazy load classes
addAco ( string $action, array $allowRoles = [] ) : void ACL: add ACO
addPluginBootstrap ( string $plugin ) : void Loads plugin's bootstrap.php file
checkPluginDependency ( string $plugin = null ) : boolean Check if plugin is dependent on any other plugin.
extractFilter ( ) : array Extracts parameters from 'filter' named parameter.
fieldToggle ( Model $model, $id, $status, $field = 'status' ) Toggle field status
getPluginData ( string $alias = null ) : array Get the content of plugin.json file of a plugin
getPlugins ( ) : array Get plugin alises (folder names)
getRelativePath ( array $url = '/' ) : array Get URL relative to the app
getThemeData ( string $alias = null ) : array Get the content of theme.json file from a theme
getThemes ( ) : array Get theme aliases (folder names)
pluginIsActive ( string $plugin ) : boolean Check if plugin is active
redirect ( string $url, integer $status = null, boolean $exit = true, array $indexUrl = [] ) : void Croogo flavored redirect
removeAco ( string $action ) : void ACL: remove ACO
removePluginBootstrap ( string $plugin ) : void Plugin name will be removed from Hook.bootstraps
roleId ( ) : integer Gets the Role Id of the current user
setReferer ( ) : void Sets the referer page
startup ( Controller $controller ) : void Startup
viewFallback ( string | array $views ) : void View Fallback

Защищенные методы

Метод Описание
_adminData ( ) : void Set variables for admin layout
_adminMenus ( ) Setup admin menu
_setupViewPaths ( Controller $controller ) : array Get a list of possible view paths for current request

Описание методов

__get() публичный Метод

Method to lazy load classes
public __get ( $name ) : Object
Результат Object

_adminData() защищенный Метод

Set variables for admin layout
protected _adminData ( ) : void
Результат void

_adminMenus() защищенный Метод

Setup admin menu
protected _adminMenus ( )

_setupViewPaths() защищенный Метод

The default view paths are retrieved view App::path('View'). This method injects the theme path and also considers whether a plugin is used. The paths that will be used for fallback is typically: - APP/View/ - APP/Themed// - APP/Themed//Plugin// - APP/Plugin/ - APP/Vendor/croogo/croogo/Croogo/View
protected _setupViewPaths ( Controller $controller ) : array
$controller Controller
Результат array A list of view paths

addAco() публичный Метод

Creates ACOs with permissions for roles.
public addAco ( string $action, array $allowRoles = [] ) : void
$action string possible values: ControllerName, ControllerName/method_name
$allowRoles array Role aliases
Результат void

addPluginBootstrap() публичный Метод

Loads plugin's bootstrap.php file
Устаревший: use CroogoPlugin::addBootstrap()
public addPluginBootstrap ( string $plugin ) : void
$plugin string Plugin name (underscored)
Результат void

checkPluginDependency() публичный Метод

If yes, check if that plugin is available in plugins directory.
Устаревший: use CroogoPlugin::checkDependency()
public checkPluginDependency ( string $plugin = null ) : boolean
$plugin string plugin alias (underscrored)
Результат boolean

extractFilter() публичный Метод

Extracts parameters from 'filter' named parameter.
Устаревший: use Search plugin to perform filtering
public extractFilter ( ) : array
Результат array

fieldToggle() публичный Метод

Toggle field status
public fieldToggle ( Model $model, $id, $status, $field = 'status' )
$model Model Model instance
$id integer Model id
$status integer current status
$field string field name to toggle

getPluginData() публичный Метод

Get the content of plugin.json file of a plugin
Устаревший: use CroogoPlugin::getData
public getPluginData ( string $alias = null ) : array
$alias string plugin folder name
Результат array

getPlugins() публичный Метод

Get plugin alises (folder names)
Устаревший: use CroogoPlugin::getPlugins()
public getPlugins ( ) : array
Результат array

getRelativePath() публичный Метод

Get URL relative to the app
Устаревший: Use Croogo::getRelativePath
public getRelativePath ( array $url = '/' ) : array
$url array
Результат array

getThemeData() публичный Метод

Get the content of theme.json file from a theme
Устаревший: use CroogoTheme::getData()
public getThemeData ( string $alias = null ) : array
$alias string theme folder name
Результат array

getThemes() публичный Метод

Get theme aliases (folder names)
Устаревший: use CroogoTheme::getThemes()
public getThemes ( ) : array
Результат array

pluginIsActive() публичный Метод

Check if plugin is active
Устаревший: use CroogoPlugin::isActive
public pluginIsActive ( string $plugin ) : boolean
$plugin string Plugin name (underscored)
Результат boolean

redirect() публичный Метод

If 'save' pressed, redirect to referer or $indexUrl instead of 'edit'
См. также: CroogoComponent::setReferer()
public redirect ( string $url, integer $status = null, boolean $exit = true, array $indexUrl = [] ) : void
$url string
$status integer
$exit boolean
$indexUrl array
Результат void

removeAco() публичный Метод

Removes ACOs and their Permissions
public removeAco ( string $action ) : void
$action string possible values: ControllerName, ControllerName/method_name
Результат void

removePluginBootstrap() публичный Метод

Plugin name will be removed from Hook.bootstraps
Устаревший: use CroogoPlugin::removeBootstrap()
public removePluginBootstrap ( string $plugin ) : void
$plugin string Plugin name (underscored)
Результат void

roleId() публичный Метод

Gets the Role Id of the current user
public roleId ( ) : integer
Результат integer Role Id

setReferer() публичный Метод

We need to know where were you, to get you back there
См. также: CroogoComponent::redirect()
public setReferer ( ) : void
Результат void

startup() публичный Метод

Startup
public startup ( Controller $controller ) : void
$controller Controller instance of controller
Результат void

viewFallback() публичный Метод

Looks for view file through the available view paths. If the view is found, set Controller::$view variable.
public viewFallback ( string | array $views ) : void
$views string | array view path or array of view paths
Результат void

Описание свойств

$_controller защищенное свойство

controller
protected Controller $_controller
Результат Controller

$_defaultRoleId защищенное свойство

Default is 3 (public)
protected int $_defaultRoleId
Результат integer

$blocksData публичное свойство

Blocks data: contains parsed value of bb-code like strings
public array $blocksData
Результат array

$components публичное свойство

Other components used by this component
public array $components
Результат array