Beispiel #1
0
                        </ul>
                    </li>
                </ul>
            </div>
            <ul class="nav navbar-nav">
                <li><a href="#">About us</a></li>
            </ul>
        </div>
    </div>
</nav>'], ['name' => 'Complex nabvars', 'description' => 'You can specify a custom <code>id</code> which will be used for the navbar’s collapsable <code>div</code>.
You can also specify custom options in the <code>vertical</code> and <code>horizontal</code> helpers which will be added to their <code>div</code> tags. ', 'php_code' => "echo BootHelp::navbar(['id'=>'navbar'], function(){\n    return [\n        BootHelp::vertical(['id'=>'vertical', 'class'=>'en', 'data-js'=>1], function(){\n            return BootHelp::link_to('Home');\n        }),\n        BootHelp::horizontal(['class'=>'en', 'data-js'=>2], function(){\n            return BootHelp::nav(['class'=>'navbar-left'], function(){\n                return\n                    BootHelp::link_to('Profile') .\n                    BootHelp::link_to('Settings');\n            });\n        })\n    ];\n});", 'result' => BootHelp::navbar(['id' => 'navbar'], function () {
    return [BootHelp::vertical(['id' => 'vertical', 'class' => 'en', 'data-js' => 1], function () {
        return BootHelp::link_to('Home');
    }), BootHelp::horizontal(['class' => 'en', 'data-js' => 2], function () {
        return BootHelp::nav(['class' => 'navbar-left'], function () {
            return BootHelp::link_to('Profile') . BootHelp::link_to('Settings');
        });
    })];
}), 'html_code' => '<nav class="navbar navbar-default" role="navigation">
    <div class="container">
        <div data-js="1" class="en navbar-header" id="vertical">
            <button data-target="#navbar" data-toggle="collapse" class="navbar-toggle" type="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand">Home</a>
        </div>
        <div id="navbar" data-js="2" class="en collapse navbar-collapse">
            <ul class="navbar-left nav navbar-nav">
Beispiel #2
0
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
use cobisja\BootHelp\BootHelp;
echo BootHelp::content_tag('header', ['id' => 'top', 'role' => 'banner'], function () {
    return BootHelp::navbar(['class' => 'navbar-brand', 'position' => 'top'], function () {
        return BootHelp::horizontal(function () {
            return BootHelp::link_to('BootHelp - PHP Helpers for Bootstrap', ['href' => '#overview']);
        });
    });
});
echo BootHelp::content_tag('h1', 'Overview', ['id' => 'overview', 'class' => 'page-header']);
echo BootHelp::content_tag('p', function () {
    return "Nowadays Bootstrap is a great framework commonly used by a lot of web designers and web developers to " . " build web sites with a \"fresh looking\" using its HTML and CSS based design templates " . "for typography, forms, buttons, navigation, and other interface components, as well " . "JavaScript extensions.";
});
echo BootHelp::content_tag('p', function () {
    return 'However, to get all of its powerful resources, usually you have to write a lot of HTML code, no matters if ' . 'you want to use a simple component, like <a href="http://getbootstrap.com/components/#modal">Modal</a> for instance.';
});
echo BootHelp::content_tag('p', function () {
    return "<code>BootHelp</code> (<strong>Boot</strong>strap <strong>Help</strong>ers) is a set of " . "classes that allow you to get all the power of Bootstrap's components with no need " . "to write any HTML code (or at least a minimun amount of it).";
});
echo BootHelp::content_tag('p', function () {
    return "You have 2 ways to use BootHelp: Using <code>BootHelp</code> abstract class and then call any of its methods. " . "The other way is to get an instance of the component you want and then echo it.";