ShtumiUsefulBundle 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
[ShtumiUsefulBundle]
git=https://github.com/shtumi/ShtumiUsefulBundle.git
target=bundles/Shtumi/UsefulBundle
For Symfony 2.0 please use branch 2.0 of ShtumiUsefulBundle:
[ShtumiUsefulBundle]
git=https://github.com/shtumi/ShtumiUsefulBundle.git
target=bundles/Shtumi/UsefulBundle
version=origin/2.0
You also should install SonataAdminBundle and all dependencies for it.
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Shtumi\UsefulBundle\ShtumiUsefulBundle(),
// ...
);
}
// app/autoload.php
$loader->registerNamespaces(array(
'Shtumi' => __DIR__.'/../vendor/bundles',
// your other namespaces
));
// app/config/routing.yml
shtumi_useful:
resource: '@ShtumiUsefulBundle/Resources/config/routing.xml'
twig:
...
form:
resources:
- ShtumiUsefulBundle::fields.html.twig
Update your configuration in accordance with using ShtumiUsefulBundle things
<script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>