Esempio n. 1
0
 /**
  * Overload __get() to return the comments as an
  * HTML-formatted string
  *
  * @param   string  key
  */
 public function __get($key)
 {
     if ($key == 'comment_list') {
         $return = '<ul>';
         foreach (parent::__get('comments') as $comment) {
             $return .= '<li>' . $comment . '</li>';
         }
         $return .= '</ul>' . PHP_EOL;
         return $return;
     }
     return parent::__get($key);
 }
Esempio n. 2
0
 public function _init()
 {
     parent::_init();
     $this->_fields += array('entry' => new Sprig_Field_BelongsTo(array('model' => 'Entry')));
 }