Skip to content

Instantly share code, notes, and snippets.

@slywalker
slywalker / pagination.ctp
Created October 5, 2011 07:25
pagination element for CakePHP on twitter bootstrap
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">
@slywalker
slywalker / bootstrap_form.php
Created October 6, 2011 05:15
form helper for CakePHP on twitter bootstrap
<?php
class BootstrapFormHelper extends AppHelper {
public $helpers = array('Html', 'Form');
public function input($name, $options = array()) {
$default = array(
'type' => null,
'label' => null,
'before' => null, // to convert .input-prepend
@slywalker
slywalker / BaseActionComponent.php
Created December 10, 2011 02:24
CakePHP2.0 BaseActionComponent
<?php
App::uses('Component', 'Controller');
App::uses('Inflector', 'Utility');
class BaseActionComponent extends Component {
public $components = array('Session');
public $Controller;