PHP code example of slywalker / twitter_bootstrap

1. Go to this page and download the library: Download slywalker/twitter_bootstrap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

slywalker / twitter_bootstrap example snippets


	class AppController extends Controller {

		public $helpers = array(
			'Session',
			'Html' => array('className' => 'TwitterBootstrap.BootstrapHtml'),
			'Form' => array('className' => 'TwitterBootstrap.BootstrapForm'),
			'Paginator' => array('className' => 'TwitterBootstrap.BootstrapPaginator'),
		);

	}

View/Layout/default.ctp:

	 echo $this->Html->css('bootstrap.min'); 
 echo $this->Html->css('bootstrap-responsive.min'); 
 echo $this->Html->script('bootstrap.min'); 
 echo $this->Form->create('Sample', array('class' => 'form-horizontal')); 
 echo $this->Form->input('field1', array(
				'label' => 'Prepended text',
				'type' => 'text',
				'class' => 'span2',
				'prepend' => '@',
				'helpBlock' => 'Here\'s some help text',
			)); 
 echo $this->Form->input('field2', array(
				'label' => 'Appended text',
				'type' => 'text',
				'class' => 'span2',
				'append' => '.00',
				'helpInline' => 'Here\'s more help text',
			)); 
 echo $this->Form->input('field3', array(
				'label' => 'Append and prepend',
				'type' => 'text',
				'class' => 'span2',
				'prepend' => '$',
				'append' => '.00',
			)); 
 echo $this->Form->input('field4', array(
				'label' => 'Append with button',
				'type' => 'text',
				'class' => 'span2',
				'append' => array('Go!', array('wrap' => 'button', 'class' => 'btn')),
			)); 
 echo $this->Form->input('field5', array(
				'label' => 'Inline checkboxes',
				'type' => 'select',
				'multiple' => 'checkbox inline',
				'options' => array('1', '2', '3'),
			)); 
 echo $this->Form->input('field6', array(
				'label' => 'Checkboxes',
				'type' => 'select',
				'multiple' => 'checkbox',
				'options' => array(
					'1' => 'Option one is this and that¡ªbe sure to > '<strong>Note:</strong> Labels surround all the options for much larger click areas and a more usable form.',
			)); 
 echo $this->Form->input('field7', array(
				'label' => 'Radio buttons',
				'type' => 'radio',
				'options' => array(
					'1' => 'Option one is this and that¡ªbe sure to 
 echo $this->Form->submit('Save changes', array(
					'div' => false,
					'class' => 'btn btn-primary',
				)); 
 echo $this->Form->end(); 
 echo $this->Session->flash(); 
 echo $this->Session->flash('auth', array(
		'element' => 'alert',
		'params' => array('plugin' => 'TwitterBootstrap'),
	)); 
 echo $this->Paginator->pagination(); 
 echo $this->Paginator->pager(); 
 echo $this->Html->breadcrumb(array(
		$this->Html->link('one', '/one'),
		$this->Html->link('two', '/two'),
		'three',
	));