Git Product home page Git Product logo

bootstrapper's Introduction

Enhanced Bootstrapper

Bootstrapper V4

Bootstrapper V4 is a set of classes that allow you to quickly create Twitter Bootstrap style markup for Laravel framework. This library was originally developed by patrick talmadge You can read the documentation here and play with the demo here

Enhanced Bootstrapper

I added the following components:

Javascript Injector

Tooltip, Popover and Datepicker needs it to produce the necessary javascript dinamically. When you use the above classes, Javascripter stores automatically the javascript code and inject it on your page:

{{Bootstrapper\Javascripter::write_javascript()}}

You can also add your own javascript with:

{{Bootstrapper\Javascripter::add_js_snippet('your code here')}}
{{Bootstrapper\Javascripter::add_js_snippet('$("#username").editable();')}}
{{Bootstrapper\Javascripter::write_javascript()}}

Modal Component

It creates a Modal window

//Simplest way to create a modal
echo bootstrapper\Modal::create('myModal')
->with_header('This is the Header!')
->with_body('Hello World');

//this create a Modal with Header and Body
echo Bootstrapper\Modal::create('myModal')
->with_header('This is the Header!')
->add_headers(array('This is one more Header!'))
->with_body('Hello World')
->add_body(array(HTML::image('http://bootstrapper.aws.af.cm/img/bootstrap-mdo-sfmoma-01.jpg')));

//This code create a Modal that loads the body from a remote file:
$modal_remote = Bootstrapper\Modal::create('myModalRemote')
->with_header('Remote body example')
->with_data_remote('/body_ext.php');

//The Modal->autoclose bool enable/disable the X button on the header
$modal_remote->autofooter = false;

Once you created a Modal you can launch it using a button or an anchor or get the lancher attributes in order to launch it with your own html tag

//This creates an anchor to launch the modal
{{ $modal->get_launch_anchor('Launch myModal via A') }}

//This shortcut creates a button that launchs the modal
{{ $modal->get_launch_button('Launch myModal via Button') }}

//Using the get_launcher_attributes() method you'll print out the necessary attributes to launch the Modal
<a href="#" {{ HTML::attributes($modal->get_launcher_attributes()) }}>Open Modal</a>

Tooltip/Popover

With this class you can use the twitter Tooltips and Popover. Don't forget to use the Javascripter to animate the tooltips once you created them.

//Simplest way to create a tooltip
This is a tooltip {{Bootstrapper\Tooltip::create('MOUSE HERE', 'This is a nice Tooltip')->get_as_anchor()}}

//This creates a Popover
This is a popover {{Bootstrapper\Tooltip::create('MOUSE HERE', 'Popover's Title', 'This is a nice Popover')->get_as('div')}}

//Creates a tooltip on bottom and codes it like a span
This is a tooltip {{Bootstrapper\Tooltip::create('MOUSE HERE', 'This is a nice Tooltip')->with_placement(Bootstrapper\Tooltip::ON_BOTTOM)->get_as_span()}}

//Uses the Tooltip as label, with Form/Former
{{Former::password("password", Bootstrapper\Tooltip::create('Password', 'This is a nice Tooltip')->get_as_span())}}

//Embeddes the Tooltip into an html (Form) element
echo Bootstrapper\Tooltip::create(Form::text("test2"), 'This is a test Tooltip created on an Html Element')
    ->with_trigger(Bootstrapper\Tooltip::TRIGGER_FOCUS)
    ->with_placement(Bootstrapper\Tooltip::ON_RIGHT)
    ->set_tooltip_for();

//Inject the javascript for the used tooltips/popovers
{{Bootstrapper\Javascripter::write_javascript()}}

bootstrapper's People

Contributors

anahkiasen avatar anaxamaxan avatar geczy avatar jarosz avatar pasvaz avatar patricktalmadge avatar raftalks avatar sineld avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.