Inheritance: extends lithium\template\Helper
Ejemplo n.º 1
0
 /**
  * overwritten link method, to support additional options
  *
  * @see lithium\template\helper\Html
  * @param string $title The content to be wrapped by an `<a />` tag,
  *               or the `title` attribute of a meta-link `<link />`.
  * @param mixed $url Can be a string representing a URL relative to the base of your Lithium
  *              application, an external URL (starts with `'http://'` or `'https://'`), an
  *              anchor name starting with `'#'` (i.e. `'#top'`), or an array defining a set
  *              of request parameters that should be matched against a route in `Router`.
  * @param array $options The additional options are:
  *              - `'icon'` _string_: adds an icon left the text, using font-awesome i-tag
  *              will automatically set `escape` option to false.
  * @return string Returns an `<a />` or `<link />` element.
  */
 public function link($title, $url = null, array $options = array())
 {
     if (isset($options['icon'])) {
         $icon = $options['icon'];
         $title = sprintf('<i class="fa fa-%s"></i> %s', $icon, $title);
         $options['escape'] = false;
     }
     return parent::link($title, $url, $options);
 }
Ejemplo n.º 2
0
 public function _init()
 {
     parent::_init();
     // Get some required values
     $facebook_config = Libraries::get('li3_facebook');
     if (!empty($facebook_config)) {
         extract($facebook_config);
     }
     $this->facebook_app_id = isset($appId) ? $appId : false;
     $this->facebook_locale = isset($locale) ? $locale : 'en_US';
 }
Ejemplo n.º 3
0
 protected function _init()
 {
     parent::_init();
     $this->_libraryConfig = Libraries::get('li3_docs');
     $this->_baseUrl = $this->_libraryConfig['url'];
 }
Ejemplo n.º 4
0
 /**
  * Returns a charset meta-tag for declaring the encoding of the document.
  *
  * @see lithium\template\helper\Html::charset()
  * @param string $encoding The character encoding to be used in the meta tag.
  *        Defaults to the encoding of the `Messagee` object attached to the
  *        current context. The default encoding of that object is `UTF-8`.
  *        The string given here is not manipulated in any way, so that
  *        values are rendered literally.
  * @return string A meta tag containing the specified encoding (literally).
  */
 public function charset($encoding = null)
 {
     $encoding = $encoding ?: $this->_context->message()->charset;
     return parent::charset($encoding);
 }
Ejemplo n.º 5
0
 protected function _init()
 {
     parent::_init();
     $this->_parser = new GithubMarkdown();
     $this->_parser->html5 = true;
 }
Ejemplo n.º 6
0
 /**
  * Gallery init.
  *
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     $this->_getGalleryFiles();
 }
Ejemplo n.º 7
0
 public function _init()
 {
     parent::_init();
     $this->_theme = isset($this->_context->_config['theme']) ? $this->_context->_config['theme'] : $this->_theme;
 }