Constants

VERSION

VERSION

Current version of MocaBonita.

Properties

$mbPages

$mbPages : \Illuminate\Support\Collection

List of MocaBonita Pages

Type

\Illuminate\Support\Collection

$mbEvents

$mbEvents : \Illuminate\Support\Collection

List of MocaBonita Events

Type

\Illuminate\Support\Collection

$mbShortCodes

$mbShortCodes : \Illuminate\Support\Collection

List of MocaBonita Shortcodes

Type

\Illuminate\Support\Collection

$mbAssets

$mbAssets : \Illuminate\Support\Collection

List of MocaBonita Assets

Type

\Illuminate\Support\Collection

$audit

$audit : boolean

Check that the plugin will be audited

Type

boolean

$page

$page : string

Stores the current name of the wordpress page

Type

string

$action

$action : string

Stores the current name of the wordpress action

Type

string

Methods

getInstance()

getInstance() : static

The singleton pattern is useful when we need to make sure that we only have a single instance of a class for the entire request lifecycle in a Web application. This usually occurs when we have global objects (such as a configuration class) or a resource (Such as an event queue).

Returns

static

__clone()

__clone() 

Clone Not allowed

Throws

\MocaBonita\tools\MbException

__wakeup()

__wakeup() 

WakeUp Not allowed.

Throws

\MocaBonita\tools\MbException

version()

version() : string

Get current version of MocaBonita

Returns

string

getMbAssets()

getMbAssets(boolean  $wordpress = false) : \MocaBonita\tools\MbAsset

Get either MbAsset from the plugin or from Wordpress

Parameters

boolean $wordpress

If it's true, then it'll return the wordpress' MbAsset. If it's false, then it'll return the plugin's MbAsset.

Returns

\MocaBonita\tools\MbAsset

getAssetsWordpress()

getAssetsWordpress() : \MocaBonita\tools\MbAsset

Get the Wordpress' MbAsset

Returns

\MocaBonita\tools\MbAsset

setMbAssets()

setMbAssets(\MocaBonita\tools\MbAsset  $mbAsset, boolean  $wordpress = false) : \MocaBonita\MocaBonita

Set either MbAsset to the plugin or to the Wordpress

Parameters

\MocaBonita\tools\MbAsset $mbAsset
boolean $wordpress

If it's true, then it'll set MbAssets to the Wordpress. If it's false, then it'll set MbAssets to the plugin.

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

setAssetsPlugin()

setAssetsPlugin(\MocaBonita\tools\MbAsset  $pluginMbAsset) : \MocaBonita\MocaBonita

Set the MbAsset to the plugin

Parameters

\MocaBonita\tools\MbAsset $pluginMbAsset

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

setAssetsWordpress()

setAssetsWordpress(\MocaBonita\tools\MbAsset  $wordpressMbAsset) : \MocaBonita\MocaBonita

Set the MbAsset to the Wordpress

Parameters

\MocaBonita\tools\MbAsset $wordpressMbAsset

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

getMbEvents()

getMbEvents(string|null  $dispatch = null) : \Illuminate\Support\Collection

Get either a MbEvent from a dispatcher type or the MbEvent list

Parameters

string|null $dispatch

If it's a string, then it'll return either an array of MbEvent or an empty array. If it's null, then it'll return all stored MbEvent

Returns

\Illuminate\Support\Collection

setMbEvent()

setMbEvent(\MocaBonita\tools\MbEvent  $mbEvent, string|array  $dispatch) : \MocaBonita\MocaBonita

Set a MbEvent to a dispatcher type

Parameters

\MocaBonita\tools\MbEvent $mbEvent
string|array $dispatch

name of dispatcher

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

getPage()

getPage() : string

Get the current name of the wordpress page

Returns

string

setPage()

setPage(string  $page) : \MocaBonita\MocaBonita

Set the current name of the wordpress page

Parameters

string $page

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

getAction()

getAction() : string

Get the current name of the wordpress action

Returns

string

setAction()

setAction(string  $action) : \MocaBonita\MocaBonita

Set the current name of the wordpress action

Parameters

string $action

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

enableSession()

enableSession(\Symfony\Component\HttpFoundation\Session\Session  $session = null) : \MocaBonita\MocaBonita

Enable session

Parameters

\Symfony\Component\HttpFoundation\Session\Session $session

Returns

\MocaBonita\MocaBonita

enableFlash()

enableFlash(\Symfony\Component\HttpFoundation\Session\Session  $session = null) : \MocaBonita\MocaBonita

Enable flash session

Parameters

\Symfony\Component\HttpFoundation\Session\Session $session

Returns

\MocaBonita\MocaBonita

plugin()

plugin(  $pluginStructure, boolean  $audit = false, string  $tag = "plugins_loaded") : void

Set the callback that has the plugin's structure

Parameters

$pluginStructure

\Closure Callback that will be called

boolean $audit

Set status audit

string $tag

active()

active(  $active) : void

Set the callback that will be called when the plugin is activated

Parameters

$active

\Closure Callback that will be called

deactive()

deactive(  $deactive) : void

Set the callback that will be called when the plugin is deactivated

Parameters

$deactive

\Closure Callback that will be called

uninstall()

uninstall(  $unistall) : void

Set the callback that will be called when the plugin is uninstalling

Parameters

$unistall

\Closure Callback that will be called

runAction()

runAction(\MocaBonita\tools\MbAction  $mbAction, \MocaBonita\view\MbView  $mbView, array  $callbackParameters = array()) : mixed

Parameters

\MocaBonita\tools\MbAction $mbAction
\MocaBonita\view\MbView $mbView
array $callbackParameters

Throws

\MocaBonita\tools\MbException

Returns

mixed

sendContent()

sendContent() : void

Send the content generated by the plugin

getMbPage()

getMbPage(string  $slugPage) : \MocaBonita\tools\MbPage

Get MbPage of slug

Parameters

string $slugPage

slug of the MbPage

Throws

\MocaBonita\tools\MbException

Returns

\MocaBonita\tools\MbPage

getMbShortcode()

getMbShortcode(string  $shortcodeName) : \MocaBonita\tools\MbShortCode

Get MbShortcode of name

Parameters

string $shortcodeName

Name of shortcode

Throws

\MocaBonita\tools\MbException

Returns

\MocaBonita\tools\MbShortCode

addMbPageStructure()

addMbPageStructure(  $pageName, \MocaBonita\tools\MbPageStructure  $mbPageStructure) 

Add page structure

Parameters

$pageName
\MocaBonita\tools\MbPageStructure $mbPageStructure

addMbPage()

addMbPage(\MocaBonita\tools\MbPage  $mbPage) : \MocaBonita\MocaBonita

Add a MbPage to MocaBonita as main menu

Parameters

\MocaBonita\tools\MbPage $mbPage

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

addSubMbPage()

addSubMbPage(\MocaBonita\tools\MbPage  $mbPage) : \MocaBonita\MocaBonita

Add a MbPage to MocaBonita as submenu

Parameters

\MocaBonita\tools\MbPage $mbPage

Returns

\MocaBonita\MocaBonita

current instance of MocaBonita

addMbShortcode()

addMbShortcode(string  $name, \MocaBonita\tools\MbPage  $mbPage, string|callable|mixed  $method) : \MocaBonita\tools\MbShortCode

Add a MbShortCode to MocaBonita

Parameters

string $name
\MocaBonita\tools\MbPage $mbPage
string|callable|mixed $method

Returns

\MocaBonita\tools\MbShortCode

addAdminMenuToWordpress()

addAdminMenuToWordpress() : void

Add admin menu to Wordpress

__construct()

__construct() 

Singleton construct

init()

init() : void

Function that's called when MocaBonita is started.

isMocabonitaPage()

isMocabonitaPage() : boolean

Check if the current page is a Mocabonita page

Returns

boolean

runPlugin()

runPlugin() : void

Initialize the processing of the plugin and its resources.

Throws

\Exception

runCurrentPage()

runCurrentPage(\MocaBonita\tools\MbPage  $mbPage) 

Execute current page resources

Parameters

\MocaBonita\tools\MbPage $mbPage

Throws

\MocaBonita\tools\MbException

runHookCurrentAction()

runHookCurrentAction() : boolean

Add Wordpress Hook for current action if needed

Returns

boolean