Skip to content

Instantly share code, notes, and snippets.

View doup's full-sized avatar
🤖

Asier Illarramendi doup

🤖
View GitHub Profile
@doup
doup / PlaceAdmin.php
Created July 21, 2013 14:52
FormType to use with Sonata + KNP DoctrineBehaviours translatable trait
<?php
namespace App\PlaceBundle\Admin;
use App\PlaceBundle\Form;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
@doup
doup / Twig search page paginator
Created July 23, 2011 22:29
Example twig paginator in Symfony2
{#
Search Page paginator
---------------------
app.request.query.all returns the GET parameters, we merge them with the "params" so that we don't lose the search GET params.
#}
{% include "paginator.html.twig" with {"page": 2, "pages": 10, "route": 'controller_index', "params": {"some": "params"}} %}
{# paginator.html.twig #}
<ul class="paginator">
var Base = {
_ops: {},
_privateFnc: function () {},
abstract: function () {},
init: function (ops) {
this._ops = ops || {};
// INIT
}
};