API Documentation for: 1.1.1
Show:

SettingsManager Class

Namespace: Canteen\Utilities

The settings manager keeps track of all Canteen settings and provides protection and access control when doing page rendering. All important global settings are registered here.

Item Index

Properties

Methods

addSetting

(
  • name
  • value
  • [access=0]
)
StateManager

Add a single setting to the settings manager

Parameters:

  • name String

    The name of the property add

  • value Mixed

    The value of the setting

  • [access=0] Int optional

    The access to enable for access, default to none

Returns:

StateManager:

Make it easier to chain

addSettings

(
  • settings
  • [access=0]
)
StateManager

Add a collection of settings to the settings manager

Parameters:

  • settings Dictionary

    The associative-array of properties

  • [access=0] Int optional

    The access to enable for access, default to none

Returns:

StateManager:

Make it easier to chain

exists

(
  • args
)
Boolean public

If multiple settings exist

Parameters:

  • args String multiple

    The data names that are required

Returns:

Boolean:

If the access check out

exists

(
  • args
)
Boolean public

If multiple settings exist, throw exception if not

Parameters:

  • args String multiple

    The data names that are required

Returns:

Boolean:

If the access check out

getClient

() Dictionary

Get the collection of settings that are okay-ed for use by the client

Returns:

Dictionary:

The collection of settings

getRender

() Dictionary

Get the collection of settings that are okay to render through templates

Returns:

Dictionary:

The collection of settings

Properties

ALL

Int final static

Enable all access

CLIENT

Int final static

Option if the setting should be available to the client, JavaScript

DELETE

Int final static

Option if the option can be deleted from the config panel

RENDER

Int final static

Option if the setting can be rendered on the page

settings

Array private

The collection of all settings

settingsMap

Dictionary private

The dictionary map of all settings

WRITE

Int final static

Option if the option can be changed from the config panel