Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ActiveRecord
  • Cache
  • Configs
  • Core
  • DateTime
  • Debug
  • DeleteOperation
  • Errors
  • Event
  • EventHook
  • Events
  • FileCache
  • FormattedString
  • Helpers
  • I18n
  • Image
  • Inflections
  • Inflector
  • Models
  • Module
  • Modules
  • Object
  • Operation
  • PingOperation
  • Prototype
  • Route
  • Routes
  • SaveOperation
  • Session
  • TimeZone
  • TimeZoneLocation
  • Uploaded
  • Vars
  • VarsIterator

Interfaces

  • StorageInterface
  • ToArray
  • ToArrayRecursive

Traits

  • PrototypeTrait
  • ToArrayRecursiveTrait

Exceptions

  • AlreadyAuthenticated
  • AuthenticationRequired
  • Exception
  • ModuleConstructorMissing
  • ModuleIsDisabled
  • ModuleNotDefined
  • OffsetError
  • OffsetNotDefined
  • OffsetNotReadable
  • OffsetNotWritable
  • PermissionRequired
  • PropertyError
  • PropertyIsReserved
  • PropertyNotDefined
  • PropertyNotReadable
  • PropertyNotWritable
  • RouteNotDefined
  • SecurityException

Constants

  • TOKEN_ALPHA
  • TOKEN_ALPHA_UPCASE
  • TOKEN_NUMERIC
  • TOKEN_SYMBOL
  • TOKEN_SYMBOL_WIDE

Functions

  • array_flatten
  • array_insert
  • array_merge_recursive
  • camelize
  • capitalize
  • downcase
  • dump
  • escape
  • escape_all
  • exact_array_merge_recursive
  • excerpt
  • format
  • generate_token
  • generate_token_wide
  • generate_v4_uuid
  • get_autoconfig
  • humanize
  • hyphenate
  • log
  • log_error
  • log_info
  • log_success
  • log_time
  • normalize
  • normalize_namespace_part
  • normalize_url_path
  • pbkdf2
  • pluralize
  • remove_accents
  • shorten
  • singularize
  • sort_by_weight
  • stable_sort
  • strip_root
  • titleize
  • unaccent_compare
  • unaccent_compare_ci
  • underscore
  • upcase

Class Errors

An error collector.

ICanBoogie\Errors implements ArrayAccess, Countable, Iterator
Namespace: ICanBoogie
Located at vendor/icanboogie/errors/lib/errors.php

Methods summary

public boolean
# offsetExists( mixed $attribute )

Checks if an error is defined for an attribute.

Checks if an error is defined for an attribute.

Example:

$e = new Errors();
$e['username'] = 'Funny username';
var_dump(isset($e['username']);
#=> true
var_dump(isset($e['password']);
#=> false

Returns

boolean
true if an error is defined for the specified attribute, false otherwise.

Implementation of

ArrayAccess::offsetExists()
public string|array|null
# offsetGet( string|null $attribute )

Returns error messages.

Returns error messages.

Example:

$e = new Errors();
var_dump($e['password']);
#=> null
$e['password'] = 'Invalid password';
var_dump($e['password']);
#=> 'Invalid password'
$e['password'] = 'Ugly password';
var_dump($e['password']);
#=> array('Invalid password', 'Ugly password')

Parameters

$attribute
string|null
$attribute The attribute that caused the error, or null if the error is global.

Returns

string|array|null
Return the global error messages or the error messages attached to an attribute. If there is only one message a string is returned, otherwise an array with all the messages is returned. null is returned if there is no message defined.

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( string|null $attribute, string $message )

Adds an error message.

Adds an error message.

Example:

$e = new Errors();
$e['password'] = 'Invalid password';
$e[] = 'Requires authentication';

Parameters

$attribute
string|null
$attribute If null, the message is considered as a general error message instead of an attribute message.
$message
string
$message The error message.

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string|null $attribute )

Removes error messages.

Removes error messages.

Parameters

$attribute
string|null
attribute If null, general message are removed, otherwise the message attached to the attribute are removed.

Implementation of

ArrayAccess::offsetUnset()
public
# count( )

Returns the number of errors defined.

Returns the number of errors defined.

Example:

$e = new Errors();
$e['username'] = 'Funny user name';
$e['password'] = 'Weak password';
$e['password'] = 'should have at least one digit';
count($e);
#=> 3

Implementation of

Countable::count()
public
# current( )

Implementation of

Iterator::current()
public
# next( )

Implementation of

Iterator::next()
public
# key( )

Implementation of

Iterator::key()
public
# valid( )

Implementation of

Iterator::valid()
public
# rewind( )

Implementation of

Iterator::rewind()
public
# each( mixed $callback )

Iterates through errors using the specified callback.

Iterates through errors using the specified callback.

Example:

$e = new Errors();
$e['username'] = 'Funny user name';
$e['password'] = 'Weak password';

$e->each(function($attribute, $message) {

    echo "$attribute => $message<br />";

});

Parameters

$callback
mixed
$callback
public
# clear( )

Clears the errors.

Clears the errors.

public mixed
# format( string $pattern, array $args = array(), array $options = array() )

Formats the given string by replacing placeholders with the values provided.

Formats the given string by replacing placeholders with the values provided.

Parameters

$pattern
string
$pattern The format pattern.
$args
array
$args An array of replacements for the placeholders.
$options
array
$options Options for the formatter.

Returns

mixed
A string or a stringyfiable object.

See

ICanBoogie\I18n\FormattedString
ICanBoogie\FormattedString
ICanBoogie\format()

Magic methods summary

Properties summary

public static mixed $message_constructor
#
protected array $errors
#
Autodoc API documentation generated by ApiGen 2.8.0