Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ajibarra/TwitterBootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

130 Commits

Repository files navigation

TwitterBootstrap Plugin for CakePHP2

About Bootstrap, from Twitter

Bootstrap, from Twitter

twitter/bootstrap - GitHub

How to install

Download files from Bootstrap, from Twitter Move files to app/Plugin/TwitterBootstrap/webroot/

Controller/AppController.php

array('className' => 'TwitterBootstrap.BootstrapHtml'), 'Form' => array('className' => 'TwitterBootstrap.BootstrapForm'), 'Paginator' => array('className' => 'TwitterBootstrap.BootstrapPaginator'), ); }">class AppController extends Controller {

// Usig as plugin's helper
public $helpers = array(
'Session', 'Html', 'Form',
'TwitterBootstrap.BootstrapHtml',
'TwitterBootstrap.BootstrapForm',
'TwitterBootstrap.BootstrapPaginator',
);

// Using as alias of core helper
public $helpers = array(
'Session',
'Html' => array('className' => 'TwitterBootstrap.BootstrapHtml'),
'Form' => array('className' => 'TwitterBootstrap.BootstrapForm'),
'Paginator' => array('className' => 'TwitterBootstrap.BootstrapPaginator'),
);
}

Copy app/Plugin/TwitterBootstrap/View/Layouts/bootstrap.ctp to app/View/Layouts/bootstrap.ctp

Usage (Using as alias of core helper)

Load CSS

Html->css(); ?> load bootstrap.min.css

Load JS

Html->script(); ?> load bootstrap.min.js

Output form input as Bootstrap format

Form->input('name'); ?> Form->inlineInputs('name', array( 'first_name' => array('class' => 'small'), ' ', 'last_name' => array('class' => 'small'), )); ?> Form->submit('Submit'); ?> Form->end(); ?>">Form->cretate('User'); ?>
Form->input('name'); ?>
Form->inlineInputs('name', array(
'first_name' => array('class' => 'small'),
' ',
'last_name' => array('class' => 'small'),
)); ?>
Form->submit('Submit'); ?>
Form->end(); ?>

Output SessionHelper::flash as Bootstrap format

'TwitterBootstrap', 'class' => 'alert-success' )); $this->Session->setFlash(__('The something could not be saved. Please, try again.'), 'alert', array( 'plugin' => 'TwitterBootstrap', 'class' => 'alert-error' )); // View Session->flash(); ?> // Auth Session->flash('auth', array( 'element' => 'alert', 'params' => array('plugin' => 'TwitterBootstrap'), )); ?>">// SomethingsController
$this->Session->setFlash(__('The something has been saved'), 'alert', array(
'plugin' => 'TwitterBootstrap',
'class' => 'alert-success'
));
$this->Session->setFlash(__('The something could not be saved. Please, try again.'), 'alert', array(
'plugin' => 'TwitterBootstrap',
'class' => 'alert-error'
));

// View
Session->flash(); ?>

// Auth
Session->flash('auth', array(
'element' => 'alert',
'params' => array('plugin' => 'TwitterBootstrap'),
)); ?>

Output Paginate as Bootstrap format

// div.pagination.pagination-centered
Paginator->pagination(); ?>
// ul.pager
Paginator->pager(); ?>

Breadcrumb

Html->link('two', '/two'), 'three', )); ?>">Html->breadcrumb(array(
$this->Html->link('one', '/one'),
$this->Html->link('two', '/two'),
'three',
)); ?>

License

The MIT License (MIT)

Copyright (c) 2012 Yasuo Harada

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

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.

About

Plugin for CakePHP2 to use Bootstrap, from Twitter (CSS JS Framework)

Resources

Readme

Stars

Watchers

Forks

Packages

Contributors

Languages

  • PHP 100.0%