当前位置: 首页>>代码示例>>PHP>>正文


PHP parent::_buffer方法代码示例

本文整理汇总了PHP中parent::_buffer方法的典型用法代码示例。如果您正苦于以下问题:PHP parent::_buffer方法的具体用法?PHP parent::_buffer怎么用?PHP parent::_buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parent的用法示例。


在下文中一共展示了parent::_buffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: read

 /**
  * Read n characters.
  *
  * @param   int     $length    Length.
  * @return  string
  * @throws  \Hoa\Xml\Exception
  */
 public function read($length)
 {
     if (0 > $length) {
         throw new Xml\Exception('Length must be greater than 0, given %d.', 0, $length);
     }
     if (null === parent::$_buffer) {
         parent::$_buffer = new Stringbuffer\ReadWrite();
         parent::$_buffer->initializeWith($this->__toString());
     }
     return parent::$_buffer->read($length);
 }
开发者ID:Grummfy,项目名称:Central,代码行数:18,代码来源:Read.php

示例2: write

 /**
  * Write n characters.
  *
  * @param   string  $string    String.
  * @param   int     $length    Length.
  * @return  mixed
  * @throws  \Hoa\Xml\Exception
  */
 public function write($string, $length)
 {
     if (0 > $length) {
         throw new Xml\Exception('Length must be greater than 0, given %d.', 0, $length);
     }
     if (null === parent::$_buffer) {
         parent::$_buffer = new Stringbuffer\ReadWrite();
         parent::$_buffer->initializeWith($this->__toString());
     }
     $l = parent::$_buffer->write($string, $length);
     if ($l !== $length) {
         return false;
     }
     $this[0] = parent::$_buffer->readAll();
     return $l;
 }
开发者ID:Grummfy,项目名称:Central,代码行数:24,代码来源:Write.php

示例3: init

 /**
  * Init the object data
  *
  * @param  array $params - the configuration parameters
  *
  * @return boolean
  * @since  1.0
  */
 public function init($params)
 {
     $this->_caching = false;
     $this->_template = null;
     $this->_letter = null;
     $this->_parsed = null;
     $this->directory = null;
     $this->parsedTags = null;
     $this->renderMode = null;
     $this->tracking = null;
     $this->trackingGa = null;
     // reset all previous rendererd data for modules or placeholders
     parent::$_buffer = array();
     $this->tracking = isset($params['tracking']) ? (bool) $params['tracking'] : true;
     $this->trackingGa = isset($params['trackingGa']) ? (bool) $params['trackingGa'] : true;
     $this->directory = !empty($params['directory']) ? $params['directory'] : JPATH_COMPONENT_ADMINISTRATOR . DS . 'extensions' . DS . 'templates';
     $this->renderMode = !empty($params['renderMode']) ? $params['renderMode'] : 'full';
     $this->showNames = !empty($params['showNames']);
     // if we already get the template then work with it.
     if (!empty($params['template'])) {
         $this->_template = $params['template'];
         return true;
     }
     // if request contains the letter ID...
     if (!empty($params['newsletter_id'])) {
         $this->_letter = $this->loadLetter($params['newsletter_id']);
         $this->_template = $this->_loadTemplate($this->_letter->t_style_id);
         return;
     }
     // And finaly try to find the template.
     if (!empty($params['t_style_id'])) {
         $this->_template = $this->_loadTemplate($params['t_style_id']);
         return true;
     }
     $this->setError('The PLAIN is not allowed because the NEWSLETTER is not loaded');
     return false;
 }
开发者ID:Rikisha,项目名称:proj,代码行数:45,代码来源:document.php

示例4: truncate

 /**
  * Truncate to a given length.
  *
  * @param   int     $size    Size.
  * @return  bool
  */
 public function truncate($size)
 {
     if (null === parent::$_buffer) {
         parent::$_buffer = new Stringbuffer\ReadWrite();
         parent::$_buffer->initializeWith($this->__toString());
     }
     return parent::$_buffer->truncate($size);
 }
开发者ID:Grummfy,项目名称:Central,代码行数:14,代码来源:ReadWrite.php


注:本文中的parent::_buffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。