2017 © Pedro Peláez
 

cakephp-plugin chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

image

paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  • Friday, January 9, 2015
  • by paulredmond
  • Repository
  • 6 Watchers
  • 73 Stars
  • 6,979 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 18 Forks
  • 1 Open issues
  • 15 Versions
  • 2 % Grown

The README.md

ChosenHelper for CakePHP 2

ChosenHelper is a class for integrating HarvestHQ Chosen select boxes in CakePHP 2. Check out HarvestHQ's demo for documentation and usage., (*1)

Build Status, (*2)

Changelog

A Changelog Wiki page is now available. Review it carefully to make sure you do not upgrade permaturely. For example: the latest version (2.1.0) includes a backwards compatability break with CakePHP 2.0.x., (*3)

Installation

Chosen CakePHP 2 plugin supports Composer and Packagist. After you download composer.phar and put it in your path:, (*4)

Composer will take care of installing the plugin into the correct location. Include the following composer.json file at path/to/app, (*5)

{
    "require": {
        "paulredmond/chosen-cakephp": "*"
    }
}

Use a sensible stable version for the plugin. The above '*' is only intended as an example., (*6)

cd path/to/app
php composer.phar install

Bootstrap the plugin in app/Config/bootstrap.php:, (*7)


cd /path/to/app/webroot
ln -s ../Plugin/Chosen/webroot chosen

Setup

In /app/Controller/AppController.php:, (*8)

 array(
        'framework' => 'prototype',
        'class'     => 'chosen-custom', // Deselect-enabled class would be 'chosen-custom-deselect'
    ),
);
```

Now all classes rendered with the helper, or other ```

Default selected:, (*9)

<?php
echo $this->Chosen->select(
    'Article.category_id',
    array(1 => 'Category 1', 2 => 'Category 2'),
    array(
        'data-placeholder' => 'Pick categories...',
        'default' => 1,
    )
);
?>

Grouped:, (*10)

<?php
echo $this->Chosen->select(
    'Profile.favorite_team',
    array(
        'NFC East' => array(
            'Dallas Cowboys',
            'New York Giants',
            'Philadelphia Eagles',
            'Washington Redskins'
        ),
        'NFC North' => array(
            'Chicago Bears',
            'Detroit Lions',
            'Greenbay Packers',
            'Minnesota Vikings'
        ),
        // ....
    ),
    array(
        'data-placeholder' => 'Pick your favorite NFL team...',
        'style' => 'width: 350px'
    )
);
?>

Deselect on Single Select:, (*11)

<?php
echo $this->Chosen->select(
    'Profile.optional',
    $options,
    array('data-placeholder' => 'Please select...', 'deselect' => true),
);
?>

Do not use 'empty' => 'Please Select...' attribute with deselect, use 'data-placeholder' => 'Please Select...' instead., (*12)

License

Copyright 2013 Paul Redmond. It is free software, and may be redistributed under the terms specified in the LICENSE file. License is also available online., (*13)

The Versions

09/01 2015

dev-master

9999999-dev https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

09/01 2015

2.2.0

2.2.0.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

12/05 2013

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

12/05 2013

2.0.9

2.0.9.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

12/05 2013

2.1.x-dev

2.1.9999999.9999999-dev https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

12/05 2013

2.1.4

2.1.4.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

02/02 2013

2.0.8

2.0.8.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

02/02 2013

2.1.3

2.1.3.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

31/01 2013

2.1.2

2.1.2.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

24/01 2013

2.1.1

2.1.1.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

13/01 2013

2.1.0

2.1.0.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 2.1

  Sources   Download

MIT

The Requires

 

plugin cakephp

06/01 2013

2.0.7

2.0.7.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 1.3 and CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

24/12 2012

2.0.6

2.0.6.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 1.3 and CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

11/07 2012

2.0.3

2.0.3.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 1.3 and CakePHP 2

  Sources   Download

MIT

The Requires

 

plugin cakephp

10/12 2011

2.0.0

2.0.0.0 https://github.com/paulredmond/chosen-cakephp

Chosen CakePHP plugin for CakePHP 1.3 and 2.0

  Sources   Download

MIT

The Requires

 

plugin cakephp