當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。