ICanBoogie/HTTP v2.4.0
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Exception
    • HTTP
      • Dispatcher
      • Headers
      • Request

Classes

  • ICanBoogie\Exception\RescueEvent
  • ICanBoogie\HTTP\CallableDispatcher
  • ICanBoogie\HTTP\Dispatcher
  • ICanBoogie\HTTP\Dispatcher\BeforeDispatchEvent
  • ICanBoogie\HTTP\Dispatcher\DispatchEvent
  • ICanBoogie\HTTP\File
  • ICanBoogie\HTTP\FileInfo
  • ICanBoogie\HTTP\FileList
  • ICanBoogie\HTTP\Headers
  • ICanBoogie\HTTP\Headers\CacheControl
  • ICanBoogie\HTTP\Headers\ContentDisposition
  • ICanBoogie\HTTP\Headers\ContentType
  • ICanBoogie\HTTP\Headers\Date
  • ICanBoogie\HTTP\Headers\Header
  • ICanBoogie\HTTP\Headers\HeaderParameter
  • ICanBoogie\HTTP\Helpers
  • ICanBoogie\HTTP\RedirectResponse
  • ICanBoogie\HTTP\Request
  • ICanBoogie\HTTP\Request\Context
  • ICanBoogie\HTTP\Response
  • ICanBoogie\HTTP\Status
  • ICanBoogie\HTTP\WeightedDispatcher

Interfaces

  • ICanBoogie\HTTP\DispatcherInterface
  • ICanBoogie\HTTP\Exception

Exceptions

  • ICanBoogie\HTTP\DispatcherNotDefined
  • ICanBoogie\HTTP\ForceRedirect
  • ICanBoogie\HTTP\MethodNotSupported
  • ICanBoogie\HTTP\NotFound
  • ICanBoogie\HTTP\ServiceUnavailable
  • ICanBoogie\HTTP\StatusCodeNotValid
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\HTTP\Headers;
13 
14 /**
15  * Representation of the `Content-Type` header field.
16  *
17  * <pre>
18  * <?php
19  *
20  * use ICanBoogie\HTTP\Headers\ContentType;
21  *
22  * $ct = new ContentType;
23  * $ct->type = "text/html";
24  * $ct->charset = "utf-8";
25  * echo $ct;                 // text/html; charset=utf-8
26  *
27  * $ct = ContentType::from("text/plain; charset=iso-8859-1");
28  * echo $ct->type;           // text/plain
29  * echo $ct->charset;        // iso-8859-1
30  * </pre>
31  *
32  * @property $type string Media type of the entity-body.
33  * @property $charset string Charset of the entity-body.
34  *
35  * @see http://tools.ietf.org/html/rfc2616#section-14.17
36  */
37 class ContentType extends Header
38 {
39     const VALUE_ALIAS = 'type';
40 
41     /**
42      * Defines the `charset` parameter.
43      *
44      * @inheritdoc
45      */
46     public function __construct($value=null, array $attributes=[])
47     {
48         $this->parameters['charset'] = new HeaderParameter('charset');
49 
50         parent::__construct($value, $attributes);
51     }
52 }
53 
ICanBoogie/HTTP v2.4.0 API documentation generated by ApiGen