Пример #1
0
 /**
  * <<magic>> Generic getter.
  * @param  string $property_name valid: timestamp, exists, content
  * @return mixed
  * @throws SmartyException if $property_name is not valid
  */
 public function __get($property_name)
 {
     switch ($property_name) {
         case 'timestamp':
         case 'exists':
             $this->handler->populateTimestamp($this);
             return $this->{$property_name};
         case 'content':
             return $this->content = $this->handler->getContent($this);
         default:
             throw new SmartyException("source property '{$property_name}' does not exist.");
     }
 }
Пример #2
0
 /**
  * Get source content
  *
  * @return string
  */
 public function getContent()
 {
     return isset($this->content) ? $this->content : $this->handler->getContent($this);
 }
 /**
  * <<magic>> Generic getter.
  *
  * @param  string $property_name valid: timestamp, exists, content
  *
  * @return mixed
  * @throws SmartyException if $property_name is not valid
  */
 public function __get($property_name)
 {
     switch ($property_name) {
         case 'content':
             return $this->content = $this->handler->getContent($this);
         default:
             throw new SmartyException("source property '{$property_name}' does not exist.");
     }
 }