CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • App
  • BasePlugin
  • ClassLoader
  • Configure
  • ObjectRegistry
  • Plugin
  • PluginCollection

Interfaces

  • ConsoleApplicationInterface
  • HttpApplicationInterface
  • PluginApplicationInterface
  • PluginInterface

Traits

  • ConventionsTrait
  • InstanceConfigTrait
  • StaticConfigTrait

Class BasePlugin

Base Plugin Class

Every plugin should extends from this class or implement the interfaces and include a plugin class in it's src root folder.

Cake\Core\BasePlugin implements Cake\Core\PluginInterface
Namespace: Cake\Core
Location: Core/BasePlugin.php

Inherited Constants

  • VALID_HOOKS

Properties summary

  • $bootstrapEnabled protected
    boolean
    Do bootstrapping or not
  • $classPath protected
    string
    The class path for this plugin.
  • $configPath protected
    string
    The config path for this plugin.
  • $consoleEnabled protected
    boolean
    Console middleware
  • $middlewareEnabled protected
    boolean
    Enable middleware
  • $name protected
    string
    The name of this plugin
  • $path protected
    string
    The path to this plugin.
  • $routesEnabled protected
    boolean
    Load routes or not

Method Summary

  • __construct() public
    Constructor
  • bootstrap() public
    Load all the application configuration and bootstrap logic.
  • checkHook() protected
    Check if a hook name is valid
  • console() public
    Add console commands for the plugin.
  • disable() public
    Disables the named hook
  • enable() public
    Enables the named hook
  • getClassPath() public
    Get the filesystem path to configuration for this plugin
  • getConfigPath() public
    Get the filesystem path to configuration for this plugin
  • getName() public
    Get the name of this plugin.
  • getPath() public
    Get the filesystem path to this plugin
  • initialize() public
  • isEnabled() public
    Check if the named hook is enabled
  • middleware() public
    Add middleware for the plugin.
  • routes() public
    Add routes for the plugin.

Method Detail

__construct() public ¶

__construct( array $options = [] )

Constructor

Parameters
array $options optional []
Options

bootstrap() public ¶

bootstrap( Cake\Core\PluginApplicationInterface $app )

Load all the application configuration and bootstrap logic.

Parameters
Cake\Core\PluginApplicationInterface $app
The host application
Implementation of
Cake\Core\PluginInterface::bootstrap()

checkHook() protected ¶

checkHook( string $hook )

Check if a hook name is valid

Parameters
string $hook
The hook name to check
Throws
InvalidArgumentException
on invalid hooks

console() public ¶

console( Cake\Console\CommandCollection $commands )

Add console commands for the plugin.

Parameters
Cake\Console\CommandCollection $commands
The command collection to update
Returns
Cake\Console\CommandCollection
Implementation of
Cake\Core\PluginInterface::console()

disable() public ¶

disable( string $hook )

Disables the named hook

Parameters
string $hook
The hook to disable
Returns

$this
Implementation of
Cake\Core\PluginInterface::disable()

enable() public ¶

enable( string $hook )

Enables the named hook

Parameters
string $hook
The hook to disable
Returns

$this
Implementation of
Cake\Core\PluginInterface::enable()

getClassPath() public ¶

getClassPath( )

Get the filesystem path to configuration for this plugin

Returns
string
Implementation of
Cake\Core\PluginInterface::getClassPath()

getConfigPath() public ¶

getConfigPath( )

Get the filesystem path to configuration for this plugin

Returns
string
Implementation of
Cake\Core\PluginInterface::getConfigPath()

getName() public ¶

getName( )

Get the name of this plugin.

Returns
string
Implementation of
Cake\Core\PluginInterface::getName()

getPath() public ¶

getPath( )

Get the filesystem path to this plugin

Returns
string
Implementation of
Cake\Core\PluginInterface::getPath()

initialize() public ¶

initialize( )

isEnabled() public ¶

isEnabled( string $hook )

Check if the named hook is enabled

Parameters
string $hook
The hook to check
Returns
boolean
Implementation of
Cake\Core\PluginInterface::isEnabled()

middleware() public ¶

middleware( Cake\Http\MiddlewareQueue $middleware )

Add middleware for the plugin.

Parameters
Cake\Http\MiddlewareQueue $middleware
The middleware queue to update.
Returns
Cake\Http\MiddlewareQueue
Implementation of
Cake\Core\PluginInterface::middleware()

routes() public ¶

routes( Cake\Routing\RouteBuilder $routes )

Add routes for the plugin.

Parameters
Cake\Routing\RouteBuilder $routes
The route builder to update.
Implementation of
Cake\Core\PluginInterface::routes()

Properties detail

$bootstrapEnabled ¶

protected boolean

Do bootstrapping or not

true

$classPath ¶

protected string

The class path for this plugin.

$configPath ¶

protected string

The config path for this plugin.

$consoleEnabled ¶

protected boolean

Console middleware

true

$middlewareEnabled ¶

protected boolean

Enable middleware

true

$name ¶

protected string

The name of this plugin

$path ¶

protected string

The path to this plugin.

$routesEnabled ¶

protected boolean

Load routes or not

true
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs