Пример #1
0
 /**
  * Sets parent container
  *
  * @param  Container $parent  [optional] new parent to set.
  *                                            Default is null which will set
  *                                            no parent.
  * @return Page               fluent interface, returns self
  */
 public function setParent(Container $parent = null)
 {
     if ($parent === $this) {
         throw new Exception('A page cannot have itself as a parent');
     }
     // return if the given parent already is parent
     if ($parent === $this->_parent) {
         return $this;
     }
     // remove from old parent
     if (null !== $this->_parent) {
         $this->_parent->removePage($this);
     }
     // set new parent
     $this->_parent = $parent;
     // add to parent if page and not already a child
     if (null !== $this->_parent && !$this->_parent->hasPage($this, false)) {
         $this->_parent->addPage($this);
     }
     return $this;
 }
Пример #2
0
$rg = $form->add(new Radiogroup('plan', 'plan', 'Select your plan:'), true);
$rg->addRadio('Silver', '0');
$rg->addRadio('Gold', '1');
$rg->addRadio('Diamond', '3', '', true);
$rg->fieldContain(true);
/**
 * Add and config a jqmCheckgroup object.
 */
$form->add('<h3>Checkbox Group</h3>');
$cg = $form->add(new Checkboxgroup(), true);
$cg->legend('Favorite Search Engine:');
$cg->addCheckbox('se1', 'se1', 'Bing');
$cg->addCheckbox('se2', 'se2', 'Google');
$cg->addCheckbox('se3', 'se3', 'Yahoo')->fieldContain(true);
/**
 * Add a new input object (submit button).
 */
//$form->add(new input('', '', 'submit', 'Send Now', '', 'b'));
/**
 * Add and config a button object with data-rel="dialog".
 */
$send = $form->add(new Button(), true);
$send->text('Send Now')->href('example-1.php?rand=' . rand(0, 9999))->attribute('data-rel', 'dialog');
/**
 * Add the page to iMobile object.
 */
$j->addPage($p);
/**
 * Generate the HTML code.
 */
echo $j;
Пример #3
0
$p->footer()->group(true)->uiBar(true)->theme('a');
/**
 * Create and config a new listview object and add Basic Items.
 */
$p->addContent('<h1>Adding Listviews</h1>');
$p->addContent('<h3>Basic</h3>');
$list1 = new Listview();
$list1->addDivider('Basic Examples', '2')->inset(true);
$list1->addBasic('Example 1', 'example-1.php');
$list1->addBasic('Example 2', 'example-2.php');
$list1->addDivider('Advanced Examples', '3')->inset(true);
$list1->addBasic('Example 3', 'example-3.php');
$list1->addBasic('Example 4', 'example-4.php');
$list1->addBasic('Example 5', '#');
$p->addContent($list1);
echo $j->addPage($p);
exit;
/**
 * Create and config a new listview object and add Icon Items.
 */
$p->addContent('<h3>Icon</h3>');
$list2 = new Listview();
$list2->inset(true)->addDivider('Animals')->dividerTheme('a');
$list2->addIcon('Dogs', '#', 'images/dog.png', '13');
$list2->addIcon('Cats', '#', 'images/cat.png', '10');
$p->addContent($list2);
/**
 * Create and config a new listview object and add Thumbnails Items.
 */
$p->addContent('<h3>Thumbnails</h3>');
$list3 = new Listview();