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

  • FormattedString
  • Helpers
  • Locale
  • NumberFormatter
  • Translator

Functions

  • date_period
  • format_currency
  • format_date
  • format_datetime
  • format_number
  • format_size
  • format_time
  • get_cldr
  • get_language
  • get_locale
  • set_locale
  • t
 1 <?php
 2 
 3 namespace ICanBoogie\I18n;
 4 
 5 use ICanBoogie\PropertyNotDefined;
 6 
 7 /**
 8  * A formatted string.
 9  *
10  * The string is formatted by replacing placeholders with the values provided.
11  *
12  * @property-read string $format String format.
13  * @property-read array $args Format arguments.
14  * @property-read array $options I18n options.
15  */
16 class FormattedString
17 {
18     protected $format;
19     protected $args;
20     protected $options;
21 
22     /**
23      * Initializes the {@link $format}, {@link $args} and {@link $options} properties.
24      *
25      * @param string $format String format.
26      * @param array $args Format arguments.
27      * @param array $options I18n options.
28      */
29     public function __construct($format, $args=null, array $options=array())
30     {
31         if (!is_array($args))
32         {
33             $args = func_get_args();
34             array_shift($args);
35             $options = array();
36         }
37 
38         $this->format = $format;
39         $this->args = (array) $args;
40         $this->options = $options;
41     }
42 
43     public function __get($property)
44     {
45         switch ($property)
46         {
47             case 'format': return $this->format;
48             case 'args': return $this->args;
49             case 'options': return $this->options;
50         }
51 
52         throw new PropertyNotDefined(array($property, $this));
53     }
54 
55     /**
56      * Returns the string formatted with the {@link format()} function.
57      *
58      * @return string
59      */
60     public function __toString()
61     {
62         return t($this->format, $this->args, $this->options);
63     }
64 }
65 
66 namespace ICanBoogie;
67 
68 class FormattedString extends I18n\FormattedString
69 {
70 
71 }
Autodoc API documentation generated by ApiGen 2.8.0