PHP 클래스 CroogoComponent

PHP version 5
저자: Fahad Ibnay Heylaal ([email protected])
상속: extends Object
파일 보기 프로젝트 열기: croogo/croogo 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$blocksData array Blocks data: contains parsed value of bb-code like strings
$components array Other components used by this component

보호된 프로퍼티들

프로퍼티 타입 설명
$_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