|
| 1 | +<?php |
| 2 | +/** |
| 3 | +* @author David Ticona Saravia |
| 4 | +*/ |
| 5 | +include "BootstrapMenu.php"; |
| 6 | +$str = '[{"text":"Home", "href": "#home", "title": "Home"}, {"text":"About", "href": "#", "title": "About", "children": [{"text":"Action", "href": "#action", "title": "Action"}, {"text":"Another action", "href": "#another", "title": "Another action"}]}, {"text":"Something else here", "href": "#something", "title": "Something else here"}]'; |
| 7 | +$qMenu = new BootstrapMenu(array('data'=>$str)); |
| 8 | +$qMenu->setActiveItem('http://codeignitertutoriales.com'); |
| 9 | +$qMenu->insert(array("text"=>'Ooh!', "href"=>'http://codeignitertutoriales.com', "title"=>'Awesome'), 'Another action', 'About'); |
| 10 | +$qMenu->insert(array("text"=>'Ultimo item', "href"=>'https://github.com/davicotico', "title"=>'My Github')); |
| 11 | +$qMenu->replace(array('text'=>'About Wow', 'href'=>'about', 'title'=>'Hey'), 'Home'); |
| 12 | +$menu = $qMenu->html(); ?> |
| 13 | +<!DOCTYPE html> |
| 14 | +<html lang="es"> |
| 15 | + <head> |
| 16 | + <meta charset="utf-8"> |
| 17 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 18 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 19 | + <meta name="description" content="Ejemplo Quick Menu"> |
| 20 | + <meta name="author" content="David Ticona Saravia"> |
| 21 | + <title>Ejemplo #2 - QuickMenu & Smartmenus</title> |
| 22 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
| 23 | + <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> |
| 24 | + <!--[if lt IE 9]> |
| 25 | + <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
| 26 | + <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> |
| 27 | + <![endif]--> |
| 28 | + <style> |
| 29 | + body {padding-top: 70px}; |
| 30 | + </style> |
| 31 | + </head> |
| 32 | + <body> |
| 33 | + <nav class="navbar navbar-default navbar-fixed-top"> |
| 34 | + <div class="container"> |
| 35 | + <div class="navbar-header"> |
| 36 | + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> |
| 37 | + <span class="sr-only">Toggle navigation</span> |
| 38 | + <span class="icon-bar"></span> |
| 39 | + <span class="icon-bar"></span> |
| 40 | + <span class="icon-bar"></span> |
| 41 | + </button> |
| 42 | + <a class="navbar-brand" href="http://codeignitertutoriales.com">PHP QuickMenu</a> |
| 43 | + </div> |
| 44 | + <div id="navbar" class="navbar-collapse collapse"> |
| 45 | + <?php echo $menu ?> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + </nav> |
| 49 | + <div class="container"> |
| 50 | + <div class="jumbotron"> |
| 51 | + <h1>PHP QuickMenu Ejemplo #2</h1> |
| 52 | + <p>Este es un ejemplo simple de creación de un menu Bootstrap.</p> |
| 53 | + <p>El menú fue generado a partir de una string JSON.</p> |
| 54 | + <p> |
| 55 | + <a class="btn btn-lg btn-primary" href="https://www.youtube.com/c/DavidTiconaSaravia" target="_blank" role="button">Inscríbete a mi canal en Youtube »</a> |
| 56 | + </p> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <!-- Placed at the end of the document so the pages load faster --> |
| 60 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> |
| 61 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
| 62 | + <!-- Plugin Smartmenus with bootstrap --> |
| 63 | + <script type="text/javascript" src="smartmenus/jquery.smartmenus.min.js"></script> |
| 64 | + <script type="text/javascript" src="smartmenus/addons/bootstrap/jquery.smartmenus.bootstrap.js"></script> |
| 65 | + </body> |
| 66 | +</html> |
0 commit comments