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

  • CacheControlHeader
  • CallableDispatcher
  • ContentDispositionHeader
  • ContentTypeHeader
  • DateHeader
  • Dispatcher
  • File
  • FileList
  • Header
  • HeaderParameter
  • Headers
  • Helpers
  • RedirectResponse
  • Request
  • Response
  • WeightedDispatcher

Interfaces

  • IDispatcher

Exceptions

  • ForceRedirect
  • HTTPError
  • MethodNotSupported
  • NotFound
  • ServiceUnavailable
  • StatusCodeNotValid

Functions

  • dispatch
  • get_dispatcher
  • get_initial_request

Class Header

Base class for header fields.

Classes that extend the class and support attributes must defined them during construct:

<?php

class ContentDisposition extends Header
{
    public function __construct($value=null, array $attributes=array())
    {
        $this->parameters['filename'] = new HeaderParameter('filename');

        parent::__construct($value, $attributes);
    }
}

Magic properties are automatically mapped to parameters. The value of a parameter is accessed through its corresponding property:

<?php

$cd = new ContentDisposition;
$cd->filename = "Statistics.csv";
echo $cd->filename;
// "Statistics.csv"

The instance of the parameter itself is accessed using the header as an array:

<?php

$cd = new ContentDisposition;
$cd['filename']->value = "Statistics.csv";
$cd['filename']->language = "en";

An alias to the ICanBoogie\HTTP\Header::$value property can be defined by using the VALUE_ALIAS constant. The following code defines type as an alias:

<?php

class ContentDisposition extends Header
{
    const VALUE_ALIAS = 'type';
}
ICanBoogie\HTTP\Header implements ArrayAccess

Direct known subclasses

ICanBoogie\HTTP\ContentDispositionHeader, ICanBoogie\HTTP\ContentTypeHeader

Abstract
Namespace: ICanBoogie\HTTP
Located at vendor/icanboogie/http/lib/headers/header.php

Methods summary

public static ICanBoogie\HTTP\Header
# from( string|ICanBoogie\HTTP\Header $source )

Creates a ICanBoogie\HTTP\Header instance from the provided source.

Creates a ICanBoogie\HTTP\Header instance from the provided source.

Parameters

$source
string|ICanBoogie\HTTP\Header
$source The source to create the instance from. If the source is an instance of ICanBoogie\HTTP\Header it is returned as is.

Returns

ICanBoogie\HTTP\Header
protected static array
# parse( string|ICanBoogie\HTTP\Header $source )

Parse the provided source and extract its value and parameters.

Parse the provided source and extract its value and parameters.

Parameters

$source
string|ICanBoogie\HTTP\Header
$source The source to create the instance from. If the source is an instance of ICanBoogie\HTTP\Header its value and parameters are returned.

Returns

array

Throws

InvalidArgumentException
if $source is not a string nor an object implementing __toString(), or and instance of ICanBoogie\HTTP\Header.
public
# offsetExists( mixed $attribute )

Checks if a parameter exists.

Checks if a parameter exists.

Implementation of

ArrayAccess::offsetExists()
public
# offsetUnset( mixed $attribute )

Sets the value of a parameter to null.

Sets the value of a parameter to null.

Implementation of

ArrayAccess::offsetUnset()
public
# offsetSet( mixed $attribute, mixed $value )

Sets the value of a parameter.

Sets the value of a parameter.

If the value is an instance of ICanBoogie\HTTP\HeaderParameter then the parameter is replaced, otherwise the value of the current parameter is updated and its language is set to null.

Throws

ICanBoogie\OffsetNotDefined
in attempt to access a parameter that is not defined.

Implementation of

ArrayAccess::offsetSet()
public ICanBoogie\HTTP\HeaderParameter
# offsetGet( mixed $attribute )

Returns a ICanBoogie\HTTP\HeaderParameter instance.

Returns a ICanBoogie\HTTP\HeaderParameter instance.

Returns

ICanBoogie\HTTP\HeaderParameter

Throws

ICanBoogie\OffsetNotDefined
in attempt to access a parameter that is not defined.

Implementation of

ArrayAccess::offsetGet()
public
# __construct( string $value = null, array $parameters = array() )

Initializes the $name, ICanBoogie\HTTP\Header::$value and ICanBoogie\HTTP\Header::$parameters properties.

Initializes the $name, ICanBoogie\HTTP\Header::$value and ICanBoogie\HTTP\Header::$parameters properties.

To enable future extensions, unrecognized parameters are ignored. Supported parameters must be defined by a child class before it calls its parent.

Parameters

$value
string
$name
$parameters
string
$value
public mixed
# __get( string $property )

Returns the value of a defined parameter.

Returns the value of a defined parameter.

The method also handles the alias of the ICanBoogie\HTTP\Header::$value property.

Parameters

$property
string
$property

Returns

mixed

Throws

ICanBoogie\PropertyNotDefined
in attempt to access a parameter that is not defined.
public
# __set( string $property, mixed $value )

Sets the value of a supported parameter.

Sets the value of a supported parameter.

The method also handles the alias of the ICanBoogie\HTTP\Header::$value property.

Parameters

$property
string
$property
$value
mixed
$value

Throws

ICanBoogie\PropertyNotDefined
in attempt to access a parameter that is not defined.
public
# __unset( string $property )

Unsets the matching parameter.

Unsets the matching parameter.

Parameters

$property
string
$property

Throws

ICanBoogie\PropertyNotDefined
in attempt to access a parameter that is not defined.
public string
# __toString( )

Renders the instance's value and parameters into a string.

Renders the instance's value and parameters into a string.

Returns

string

Magic methods summary

Constants summary

mixed VALUE_ALIAS null
#

Properties summary

public string $value
#

The value of the header.

The value of the header.

protected array[string]HeaderParameter $parameters
#

The parameters supported by the header.

The parameters supported by the header.

Autodoc API documentation generated by ApiGen 2.8.0