jimigrunge / bootstrap-colorpicker-bundle
Symfony2 bundle for wrapping the famous bootstrap-colorpicker jquery plugin by @mjolnic
Installs: 6 831
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: ~2.3|~3.0
This package is auto-updated.
Last update: 2025-01-09 15:12:31 UTC
README
Current Version
Installation
From the commandline
$ php composer.phar require jimigrunge/bootstrap-colorpicker-bundle
OR configure it manually
####Add bundle to your composer.json file
{
"require": {
// ...
"jimigrunge/bootstrap-colorpicker-bundle": "2.3"
}
}
Run commanline installer
$ php composer.phar update jimigrunge/bootstrap-colorpicker-bundle
Add bundle to your application kernel (app/AppKernel.php)
public function registerBundles()
{
$bundles = array(
// ...
new JimiGrunge\BootstrapColorPickerBundle\BootstrapColorPickerBundle(),
// ...
);
}
Install assets
Given your server's public directory is named "web", install the public vendor resources
$ php bin/console assets:install web
Optionally, use the --symlink attribute to create links rather than copies of the resources
$ php bin/console assets:install --symlink web
Usage
Once all the resources are in place you can edit any of your twig views or layouts to include the bootstrap-colorpicker javascript files.
Note: bootstrap-colorpicker requires the jQuery library.
{% block javascripts %}
<script src="//code.jquery.com/jquery-2.2.1.min.js"></script>
{% javascripts
...
'@BootstrapColorPickerBundle/Resources/public/js/bootstrap-colorpicker.min.js'
...
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
Then you will want to load the css resources so your select elements look nice:
{% block stylesheets %}
{% stylesheets filter='cssrewrite'
...
'bundles/bootstrapcolorpicker/css/bootstrap-colorpicker.min.css'
...
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
{% endblock %}
Assetic
Dump bundled files to the filesystem.
$ php bin/console assetic:dump
Licenses
I do not own bootstrap-colorpicker files at all, I'm just providing a Bundle package to easy-install them all. Refer to the source code of the included files from Select2 for license information.