slad / useful-bundle
Symfony ShtumiUsefulBundle
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 67
Language:JavaScript
Type:symfony-bundle
Requires
- php: >=5.3.2
Suggests
- sonata-project/admin-bundle: master-dev
- sonata-project/doctrine-orm-admin-bundle: master-dev
This package is not auto-updated.
Last update: 2024-12-31 23:13:57 UTC
README
SladUsefulBundle provides some useful things that needed almost in every project. It's:
Form types:
-
Ajax Autocomplete form type (useful when you operate with thousands and hundred thousands records [for instance: users])
-
Dependent filtered form type (useful when you need operate dependent entities in one form (for instance: countries/regions))
-
Date range form type (allows you select date range with JS calendar and take valid DateRange object)
-
IF
-
IFNULL
-
ROUND
-
DATE_DIFF
You can use Ajax autocomplete form type as a filter type with SonataAdminBundle
Installation
Add the following lines to your composer
file and then run composer update
:
"slad/useful-bundle": "1.0.x-dev"
You also should install SonataAdminBundle and all dependencies for it.
Add SladUsefulBundle to your application kernel
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Slad\UsefulBundle\ShtumiUsefulBundle(),
// ...
);
}
Import routes
// app/config/routing.yml
slad_useful:
resource: '@SladUsefulBundle/Resources/config/routing.xml'
Update your configuration
Add form theming to twig
twig:
...
form:
resources:
- SladUsefulBundle::fields.html.twig
Update your configuration in accordance with using SladUsefulBundle things
Load jQuery to your views
<script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>