示例#1
0
 public function start($id, $visible = false)
 {
     $tab = new Html('div');
     $tab->setClosingType(Html::CLOSE_TYPE_NONE);
     $tab->addAttribute('class', 'pecee-tablist');
     $tab->addAttribute('data-id', $id);
     $tab->addAttribute('data-visible', $visible ? 'true' : 'false');
     return $tab;
 }
 public function __construct()
 {
     parent::__construct();
     // This is really not required, but if you want you can change the doctype like so..
     $this->getSite()->setDocType(Site::DOCTYPE_HTML_5);
     // GetSite contains information about the site - here we can add javascript and change styling etc.
     $this->getSite()->setTitle('Test site');
     $this->getSite()->addWrappedCss('style.css');
     $this->getSite()->addWrappedJs('jquery-1.11.3.min.js');
     $this->getSite()->addWrappedJs('global.js');
     $this->getSite()->addWrappedJs('pecee.js');
     // Add meta viewport field
     $object = new Html('meta');
     $object->setClosingType(Html::CLOSE_TYPE_SELF);
     $object->addAttribute('name', 'viewport');
     $object->addAttribute('content', 'width=device-width, initial-scale=1');
     $this->getSite()->addHeader($object);
     // Add entry to debug class
     Debug::GetInstance()->add('NU HAR JEG LOADED ABSTRACT');
     // OVERSTÅENDE SVARER TIL AT GØRE SÅDAN HER
     //$this->getSite()->addMeta('viewport', 'width=device-width, initial-scale=1');
 }
示例#3
0
 /**
  * Create button element
  * @param string $text
  * @param string|null $type
  * @param string|null $name
  * @param string|null $value
  * @return Html
  */
 public function button($text, $type = null, $name = null, $value = null)
 {
     $el = new Html('button');
     $el->addInnerHtml($text);
     if ($type !== null) {
         $el->addAttribute('type', $type);
     }
     if ($name !== null) {
         $el->addAttribute('name', $name);
     }
     if ($value !== null) {
         $el->addAttribute('value', $value);
     }
     $el->setClosingType(Html::CLOSE_TYPE_TAG);
     return $el;
 }