* @package iMobile * @filesource */ /** * Create a new Php object. */ $iMobile = new Container(); /** * Adding custom CSS to head in iMobile */ $iMobile->head()->title('Custom CSS Example'); $iMobile->head()->add(new Link('custom.css')); /** * Create a new page object. */ $p = new Page('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 head object [<b>' . htmlspecialchars('$iMobile->head()') . '</b>] in the iMobile instance. '); $p->addContent('To facilitate the addition of CSS you can use the class <b>link</b> as example:</p>'); $p->addContent('<pre class="ui-body-c">$iMobile = new Php();' . "\n" . '$iMobile->head()->add(' . "\n\t" . 'new link(\'custom.css\')' . "\n" . ');</pre>'); /** * Adding Source Code Links.
use iMobile\Tag\Page; use iMobile\Tag\Script; use iMobile\Tag; /** * Create a new Php object. */ $iMobile = new Container(); /** * Adding custom JavaScript to head in iMobile */ $iMobile->head()->title('Custom JS Example'); $iMobile->head()->add(new Script('custom.js')); /** * Create a new page object. */ $p = new Page('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 head object [<b>' . htmlspecialchars('$iMobile->head()') . '</b>] in the iMobile instance. '); $p->addContent('To facilitate the addition of JS you can use the class <b>script</b> as example:</p>'); $p->addContent('<pre class="ui-body-c" style="padding:20px;">$iMobile = new Php();' . "\n" . '$iMobile->head()->add(' . "\n\t" . 'new script(\'custom.js\')' . "\n" . ');</pre>'); $p->addContent(new Tag('p', 'p_js', array('class="ui-body-c" style="padding:20px;"'), array(' '))); /**