Ejemplo n.º 1
0
 public function renderComponent()
 {
     $content = "";
     if ($this->hasProperty('_sub')) {
         foreach ($this->getPropertyValue('_sub') as $post) {
             $title = isset($post['title']) ? $post['title'] : 'no title';
             $user = isset($post['user']) ? $post['user'] : '******';
             $msg = isset($post['msg']) ? $post['msg'] : 'no message';
             $content .= "\n\t\t\t\t<div class='post'>\n\t\t\t\t\t<div class='title'>{$title}</div>\n\t\t\t\t\t<div class='user'>Posted by {$user}</div>\n\t\t\t\t\t<div class='text'>{$msg}</div>\n\t\t\t\t</div>";
         }
     }
     $this->xtpl->assign('CONTENT', $content);
     return parent::renderComponent();
 }
Ejemplo n.º 2
0
 public function renderComponent()
 {
     $content = "";
     if ($this->hasDatasource()) {
         $ds = $this->getDatasource();
         foreach ($ds->content as $item) {
             $label = isset($item['label']) ? $item['label'] : 'no label';
             $target = isset($item['target']) ? $item['target'] : '';
             $page = isset($item['page']) ? $item['page'] : '';
             $this->xtpl->assign('LABEL', $label);
             if ($page == 'true') {
                 $this->xtpl->assign('TARGET', '?page=' . $target);
             } else {
                 $this->xtpl->assign('TARGET', $target);
             }
             $this->xtpl->parse('main.item');
         }
     }
     $this->xtpl->assign('CONTENT', $content);
     return parent::renderComponent();
 }
Ejemplo n.º 3
0
 public function renderComponent()
 {
     $text = $this->hasProperty('text') && $this->getPropertyValue('text') != '' ? $this->getPropertyValue('text') : 'no text';
     $this->xtpl->assign('CONTENT', $text);
     return parent::renderComponent();
 }