SanSIS Base Bundle for Symfony development
This Bundle for Symfony solves some of the most basic issues on web development at SanSIS. Currently, there are over 15 projects using it directly on the brazilian government., (*1)
A responsive interface, an easy to use way to create cruds (automation on the way), user administration, and the mini data-mining bundle plus the messaging bundle provides eveything small enterprises look for when trying to reduce costs on their development., (*2)
Serving as base for the development, it forces the programmer to adopt a lot of good practices and to follow standards for their codind., (*3)
"friendsofsymfony/jsrouting-bundle" : "1.4.*@dev", "braincrafted/bootstrap-bundle" : "2.0.*", "twitter/bootstrap" : "3.1.*", "knplabs/knp-menu-bundle" : "1.1.2", "knplabs/knp-paginator-bundle" : "~2.4", "psliwa/pdf-bundle" : "dev-master"
composer.json:, (*4)
[...] "require" : { [...] "sansis/basebundle" : "dev-master" }, "repositories" : [{ "type" : "vcs", "url" : "https://github.com/phackwer/BaseBundle.git" }], [...]
//SanSIS Core Production Bundles new SanSIS\Core\BaseBundle\SanSISCoreBaseBundle(),
san_sis_core_base: resource: "@SanSISCoreBaseBundle/Resources/config/routing.yml" prefix: /
Use {% extends "SanSISCoreBaseBundle::base.html.twig" %} on your twig templates to work ok Remember you can change a lot of blocks. Check the resource and modify the blocks you want., (*5)
Change your kernel to extend from the one provided by BaseBundle., (*6)
Change:, (*7)
use Symfony\Component\HttpKernel\Kernel;
To:, (*8)
use SanSIS\Core\BaseBundle\Component\HttpKernel\Kernel;
This is a sample on how to create your own visual identity and the main blocks of code for your page layout, (*9)
{% extends "SanSISCoreBaseBundle::base.html.twig" %}, (*10)
{% block css %} {% endblock %}, (*11)
{% block title %}Company's name - System's name{% endblock %}, (*12)
{% block sigla_sistema %}SYS{% endblock %} {% block descricao_sistema %}System's name{% endblock %}, (*13)
{% block entidade_sistema %}Entity's name{% endblock %} {% block info_sessao %}Anything you want{% endblock %}, (*14)
{% block page_menu %}{{ knp_menu_render('YourProjectBundle:Builder:menu', {'nav_type': 'navbar', 'template':'SanSISCoreBaseBundle:menu:sansis_menu.html.twig'}) }}{% endblock %}, (*15)
{% block copyright_footer %} © Company's name {% endblock %}, (*16)
{% block javascript_libs %} {% endblock %}, (*17)
The most amazing and useful function of BaseBundle is the Crud Infrastructure created for it., (*18)
You may use it for complex entities with a huge number of inner entities (that can have their own inner entity as well!)., (*19)
For this, you must declare the @innerEntity annotation on top of vars that are ArrayCollections from Doctrine project., (*20)
And your form field's names must follow the object infrastructure., (*21)
Here are the objects you must extend from in order to get it working:, (*22)