include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Adding custom JavaScript to jqmHead in jqmPhp */ $jqmPhp->head()->title('Custom JS Example'); $jqmPhp->head()->add(new jqmScript('custom.js')); /** * Create a new jqmPage object. */ $p = new jqmPage('custom-js'); $p->theme('b'); $p->title('Custom JS Example'); $p->header()->theme('a'); $bt = $p->header()->addButton('', 'index.php#', 'a', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Content. */ $p->addContent('<h1>Adding Custom JavaScript</h1>'); $p->addContent('<p align="justify">To add a custom JS you need add the tag <b>' . htmlspecialchars('<script...></script>') . '</b>'); $p->addContent(' to the jqmHead object [<b>' . htmlspecialchars('$jqmPhp->head()') . '</b>] in the jqmPhp instance. '); $p->addContent('To facilitate the addition of JS you can use the class <b>jqmScript</b> as example:</p>'); $p->addContent('<pre class="ui-body-c" style="padding:20px;">$jqmPhp = new jqmPhp();' . "\n" . '$jqmPhp->head()->add(' . "\n\t" . 'new jqmScript(\'custom.js\')' . "\n" . ');</pre>'); $p->addContent(new jqmTag('p', 'p_js', 'class="ui-body-c" style="padding:20px;"', ' ')); /** * Adding Source Code Links. */
/** * Adds a page (jqmPage) to the pages collection of HTML Body element (jqmBody). * @param jqmPage $page * @param bool $returnAdded * @return jqmPhp|jqmPage */ function addBasicPage($id, $title, $content, $returnAdded = false) { $page = new jqmPage($id); $page->title($title)->addContent($content); $this->_html->body()->addPage($page); if ($returnAdded) { return $page; } return $this; }
* @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Create a new jqmPage object. */ $p = new jqmPage('simple-xml'); $p->theme('b'); $p->title('Cars'); $bt = $p->header()->addButton('', 'index.php#', 'b', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Listview to jqmPage. */ $lv = $p->addContent(new jqmListviem(), true); $lv->filter(true); /** * Reading XML; */ $xml = @simplexml_load_file('cars.xml') or die("error loading xml file."); foreach ($xml->brandGroup as $brandGroup) { /** * Adding Dividers. */
include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Adding custom CSS to jqmHead in jqmPhp */ $jqmPhp->head()->title('Custom CSS Example'); $jqmPhp->head()->add(new jqmLink('custom.css')); /** * Create a new jqmPage object. */ $p = new jqmPage('custom-css'); $p->theme('b'); $p->title('Custom CSS Example'); $p->header()->theme('a'); $bt = $p->header()->addButton('', 'index.php#', 'a', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Content. */ $p->addContent('<h1>Adding Custom CSS</h1>'); $p->addContent('<p align="justify">To add a custom CSS you need add the tag <b>' . htmlspecialchars('<link...></link>') . '</b>'); $p->addContent(' to the jqmHead object [<b>' . htmlspecialchars('$jqmPhp->head()') . '</b>] in the jqmPhp instance. '); $p->addContent('To facilitate the addition of CSS you can use the class <b>jqmLink</b> as example:</p>'); $p->addContent('<pre class="ui-body-c">$jqmPhp = new jqmPhp();' . "\n" . '$jqmPhp->head()->add(' . "\n\t" . 'new jqmLink(\'custom.css\')' . "\n" . ');</pre>'); /** * Adding Source Code Links. */ $list = new jqmListview();
* @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $j = new jqmPhp(); /** * Create a new jqmPage object. */ $p = new jqmPage('example-2'); $p->theme('b'); $p->title('Example 2'); $p->header()->addButton('Example 1', 'example-1.php#', 'a', 'arrow-l'); $p->header()->addButton('Example 3', 'example-3.php#', 'b', 'arrow-r'); $p->header()->theme('a'); $p->addContent('<h1>Adding Pages</h1>'); $p->addContent('<p>In this example we create a page (jqmPage),'); $p->addContent(' add content and buttons to the header.'); $p->addContent(' After we add the page to jqmPhp object.</p>'); $p->addContent('<a href="index.php#" data-role="button" data-theme="a">Home</a>'); $p->addContent('<a href="example-3.php#" data-role="button">Example 3</a>'); $p->footer()->title('Example 2 Footer'); $p->footer()->position('fixed'); $p->footer()->theme('a'); /** * Add the page to jqmPhp object. */