1 | <?php |
||
5 | class Bootstrap3Navbar extends Bootstrap3 |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * This will open a new navbar. |
||
10 | * |
||
11 | * @param mixed $brand The name of your website. If this is a string then it will automatically link to your ``$page->url['base']``. If you want to override that, then make this an ``array($brand, $link)``. |
||
12 | * @param string $align Either '**top**', '**bottom**', or '**static**' if you want to fix the alignment. If you are just trying to get to the next arg then you can declare '**inverse**' here and we will know what you are talking about. |
||
13 | * @param mixed $inverse If this is anything but false (eg. '****inverse**') then we will display the inverted or alternate navbar. |
||
14 | * |
||
15 | * @return string |
||
16 | * |
||
17 | * ```php |
||
18 | * echo $bp->navbar->open($ci->blog->get('name'), 'top', 'inverse'); |
||
19 | * ``` |
||
20 | */ |
||
21 | 1 | public function open($brand, $align = '', $inverse = false) |
|
58 | |||
59 | /** |
||
60 | * This will create a menu of links across your navbar. |
||
61 | * |
||
62 | * @param array $links An ``array($name => $href, ...)`` of links. If ``$href`` is an array unto itself, then it will be turned into a dropdown menu with the same header and divider rules applied as with buttons. |
||
63 | * @param array $options The options available here are: |
||
64 | * |
||
65 | * - '**active**' => $name, $href, 'url', 'urlquery', or number (starting from 1) |
||
66 | * - '**disabled**' => $name or $href or number (starting from 1) |
||
67 | * - '**pull**' => 'left' (default) or 'right' |
||
68 | * |
||
69 | * @return string |
||
70 | * |
||
71 | * ```php |
||
72 | * echo $bp->navbar->menu(array( |
||
73 | * 'Home' => '#', |
||
74 | * 'Work' => '#', |
||
75 | * 'Dropdown' => array( |
||
76 | * 'Action' => '#', |
||
77 | * 'More' => '#', |
||
78 | * ), |
||
79 | * ), array('active'=>'Home')); |
||
80 | * ``` |
||
81 | */ |
||
82 | 1 | public function menu(array $links, array $options = array()) // array('active'=>'name or url', 'pull'=>'left or right') |
|
89 | |||
90 | /** |
||
91 | * This is used in exactly the same manner as $bp->button(...), except that it will be added to the navbar, and receive the navbar-btn class. |
||
92 | * |
||
93 | * @param string $class |
||
94 | * @param string $name |
||
95 | * @param array $options |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function button($class, $name, array $options = array()) |
|
109 | |||
110 | /** |
||
111 | * This is used in exactly the same manner as ``$bp->search(...)``, but modified slightly for use in a navbar. |
||
112 | * |
||
113 | * @param string $url The same as it's parent. |
||
114 | * @param array $form The same as it's parent, except for the default '**class**' which is '**navbar-form navbar-right**'. |
||
115 | * |
||
116 | * @return string |
||
117 | * |
||
118 | * ```php |
||
119 | * echo $bp->navbar->search($page->url()); |
||
120 | * ``` |
||
121 | */ |
||
122 | 1 | public function search($url, array $form = array()) |
|
130 | |||
131 | /** |
||
132 | * This adds a string of text to the navbar. It will be wrapped in a ``<p>`` tag, and any ``<a>``'s it finds will also receive their special class treatment. |
||
133 | * |
||
134 | * @param string $string The message you would like to get across. |
||
135 | * @param string $pull Either '**left**' or '**right**'. |
||
136 | * |
||
137 | * @return string |
||
138 | * |
||
139 | * ```php |
||
140 | * echo $bp->navbar->text('You <a href="#">link</a> me'); |
||
141 | * ``` |
||
142 | */ |
||
143 | 1 | public function text($string, $pull = false) |
|
149 | |||
150 | /** |
||
151 | * This method will add the final ``<div>``'s to your navbar. |
||
152 | * |
||
153 | * @return string |
||
154 | * |
||
155 | * ```php |
||
156 | * echo $bp->navbar->close(); |
||
157 | * ``` |
||
158 | */ |
||
159 | 1 | public function close() |
|
163 | } |
||
164 |