API Documentation for: 1.1.1
Show:

PageForm Class

Extends ObjectForm
Namespace: Canteen\Forms

Update or add a user. Located in the namespace Canteen\Forms.

Methods

add

() protected

Inherited from ObjectForm:

Add a new object

error

(
  • message
)
protected

Inherited from Form:

Convenience function for passing an error to the form factory

Parameters:

  • message String

    The str error to pass

getData

(
  • name
  • value
)
protected

Inherited from Form:

Save the form data to the form factory

Parameters:

  • name String

    The name of the variable to save

  • value Mixed

    The value of the variable to save

getObject

(
  • id
)
Object private

Inherited from ObjectForm:

Generalized get object by ID

Parameters:

  • id Int

    The unique object id

Returns:

Object:

The object, or null

onAdded

(
  • event
)

Handler write the content file after we added

Parameters:

onBeforeRemove

(
  • event
)

Event handler before a page is removed

Parameters:

onBeforeUpdate

(
  • event
)

Handler to do some extra privilege checking before we update

Parameters:

onRemoved

(
  • event
)

Event handler after a page is removed

Parameters:

onValidate

(
  • event
)

Handler to do some validation before an add or update

Parameters:

parse

(
  • content
  • substitutions
)
String protected

Inherited from CanteenBase

Convenience method for parsing content

Parameters:

  • content String

    The string to parse

  • substitutions Dictionary

    The dictionary of tags to replace

Returns:

String:

The parsed string

privilege

(
  • [required=Privilege::GUEST]
)
protected

Inherited from Form:

You can run to make sure a process requires a particular privilege

Parameters:

  • [required=Privilege::GUEST] Int optional

    The privilege level required, default is anonymous

remove

() protected

Inherited from ObjectForm:

Generalized remove function

service

(
  • alias
)
Service protected

Inherited from CanteenBase:

Get a service by alias

Parameters:

Returns:

Service:

The service matching the alias

success

(
  • message
)
protected

Inherited from Form:

Convenience function for passing a success message to the form factory

Parameters:

  • message String

    The str success message to pass

template

(
  • name
  • [substitutions=[]
)
String protected

Inherited from CanteenBase:

Convenience method for parsing content

Parameters:

  • name String

    The name of the template to parse

  • [substitutions=[] Dictionary optional

    The dictionary of tags to replace

Returns:

String:

The parsed string

update

() protected

Inherited from ObjectForm:

Update the object

validate

() private

Inherited from ObjectForm:

Do some initial sanitize

verify

(
  • data
  • [type=null]
  • [suppressErrors=false]
)
Mixed protected

Inherited from Form:

Sanitize input data using the validation types above

Parameters:

  • data Mixed

    The data to be validated, can be an array of items

  • [type=null] RegExp optional

    The type of validation, defaults to Numeric. Can also be an array set of items

  • [suppressErrors=false] Boolean optional

    If we should suppress throwing errors

Returns:

Mixed:

If we don't verify and suppress errors, returns false, else returns the data

Properties

addRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after an add

Default: true

cache

ServerCache

Inherited from CanteenBase:

Get the instance of the site cache

ifError

Boolean

Inherited from Form:

If we've reported errors

item

ObjectServiceItem protected

Inherited from ObjectForm:

The object service item reference

parser

Parser

Inherited from CanteenBase:

The parser is responsible for rendering templates

profiler

Profiler

Inherited from CanteenBase:

The instance of the profiler for debugging performance

redirect

String protected

Inherited from ObjectForm:

The redirect uri after remove or add

removeRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after a remove

Default: true

settings

SettingsManager

Inherited from CanteenBase:

Get the instance of the settings manager

site

Site

Inherited from CanteenBase:

Convenience getter for the site

updateNothingError

Boolean protected

Inherited from ObjectForm:

If we should do the update nothing error

Default: true

updateRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after an update

Default: true

user

Authorization

Inherited from CanteenBase:

Get the Authorization class to handle things like login, password change