addiks/shtumi-useful-bundle

Symfony ShtumiUsefulBundle

Installs: 3 183

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 68

Language:JavaScript

Type:symfony-bundle

dev-master 2024-02-22 11:31 UTC

This package is auto-updated.

Last update: 2024-10-22 12:59:49 UTC


README

ShtumiUsefulBundle provides some useful things that needed almost in every project. It's:

Form types:

DQL extra functions:

  • 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 deps file and then run php bin/vendors install:

[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.

Add ShtumiUsefulBundle to your application kernel

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new Shtumi\UsefulBundle\ShtumiUsefulBundle(),
            // ...
        );
    }

Register the ShtumiUsefulBundle namespace

    // app/autoload.php
    $loader->registerNamespaces(array(
        'Shtumi'            => __DIR__.'/../vendor/bundles',
        // your other namespaces
    ));

Import routes

// app/config/routing.yml

shtumi_useful:
    resource: '@ShtumiUsefulBundle/Resources/config/routing.xml'

Update your configuration

Add form theming to twig

twig:
    ...
    form:
        resources:
            - ShtumiUsefulBundle::fields.html.twig

Update your configuration in accordance with using ShtumiUsefulBundle things

Load jQuery to your views

    <script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>