Coder Social home page Coder Social logo

symfony2admingenerator / admingeneratorgeneratorbundle Goto Github PK

View Code? Open in Web Editor NEW
360.0 35.0 125.0 11.04 MB

(old-legacy) Admingenerator for Symfony2, parse generator.yml files to build classes

Home Page: http://symfony2admingenerator.org/

License: MIT License

PHP 89.48% CSS 2.55% JavaScript 7.97%

admingeneratorgeneratorbundle's Introduction

Symfony2 Admin Generator


![Gitter](https://badges.gitter.im/Join Chat.svg)

KnpBundles Badge project status build status Latest Stable Version Total Downloads

The Real Missing Admin Generator for Symfony2!

This package is a Symfony2 Admin Generator based on YAML configuration and Twig templating. It's inspired by fzaninotto/Doctrine2ActiveRecord.

Follow us on Twitter!

Don't miss any updates from Symfony2 Admin Generator! Join Twitter today and follow us!

Features:

  • Generate Views and Controllers for Models with one command
  • Configure all options in one (per model) YAML file
  • Includes standard actions: create/edit, show, delete, list/nestedset tree list
  • Flexible and extendable: you can easily add or overwrite almost everything!
  • Supports most popular model managers: Doctrine ORM, Doctrine ODM and Propel
  • Introduces nested forms: create/edit object and all it's associated objects in one form!
  • Manage relations one to one, one to many, many to one and many to many
  • Fully translatable: all field elements (labels, placeholders, helpers), all widgets, actions, error messages and titles
  • List features: sortable, paginated, filters, batch actions, scopes
  • Nestedset tree list features: drag&drop to manage your tree
  • New/Edit featues: fieldsets, tabbable, cool widgets for collection, file upload, date and entity fields
  • Translated into DE, EN (default), ES, FA, FR, GR, IT, JA, NL, PL, PT, RO, RU, SL, TR, UK (you can easily contribute to add your own)
  • Credentials for actions, columns and form fields
  • Complete admin design based on twitter bootstrap (see next section)
  • ... and more!

This bundle in pictures

Preview of list

Preview of edit

Preview of dashboard

Important note

Documentation is currently being rewritten. Old documentation can be found in:

Sorry for inconvenience, we will fix that as soon as possible!

Installation

All the installation instructions are located in documentation.

Documentation

The documentation for this bundle is located in Resources/doc directory. Start by reading Table of contents.

Support

If you're haveing trouble or you found an error feel free to open a github ticket, but first please read submitting issues.

Sensio Connect

https://connect.sensiolabs.com/club/symfony2admingenerator

admingeneratorgeneratorbundle's People

Contributors

battika avatar bmelman avatar bobvandevijver avatar cbou avatar cedriclombardot avatar daum avatar denys281 avatar eexbee avatar enkaho avatar eymengunay avatar fabienpomerol avatar jaugustin avatar jpetitcolas avatar k-phoen avatar l3l0 avatar loostro avatar mazenovi avatar mikeyudin avatar montabou avatar neoshadybeat avatar pakaufmann avatar restless-et avatar sescandell avatar soeren-helbig avatar tahabayrak avatar thibmonier avatar uavn avatar vbardales avatar vitaliytv avatar willdurand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

admingeneratorgeneratorbundle's Issues

Multi entity

Hello,

first, great job and sorry for my bad English.

maybe if you can, and my low level of symfony2 will not let me understand this, but for now it is not possible to define the configuration for various entities in the generator.yml, right? As I understand it now, we must define a bundle for each entity...

Sorry if I'm wrong.

thanks

js for array type seems to be broken

I'm setting up an admin for the FOSUserBundle.

The problem is with the roles field, which is a doctrine mapping type of array.

The roles field is displayed with the list of roles the user has, numbered 0 .. n, and the 'Add' button shows with the '+' icon, and the html source shows the Add button is inside an anchor tag.

So far so good.

However, the Add button is not clickable.

The problem seems to be the js.

The generated javascript looks like this:

<script type="text/javascript">
    $(document).ready(function() {

         type_collection_roles_nextId = $('#edit_user_roles > div').length;

        $('#type_collection_roles .new').click(function() {
             var prototype = $('#edit_user_roles').attr('data-prototype');
             prototype = prototype.replace(/\$\$name\$\$/g, type_collection_roles_nextId);
             type_collection_roles_nextId++;
             $('#edit_user_roles').append(prototype);
             $('#edit_user_roles > div:last').append("<a class=\"delete\"> </a>");

             $('#edit_user_roles .delete').click(function() { //@todo make a function for this
                  $(this).parent('div').remove();
              });
         });

         $('#edit_user_roles > div').append("<a class=\"delete\"> </a>");

         $('#edit_user_roles .delete').click(function() {
               $(this).parent('div').remove();
            });
     });
    </script>

Possibility to change/prefix route names

Is there an easy way to replace or prefix the generated routes from RoutingLoader, or do I have to replace the whole load function? Would be great it this could be configurable.

Reason:
I use JMSI18nRouting and don't want the AdminGenerator to be precessed by the bundle as it causes problems with the PagerfantaExtension inside AdminGenerator and I do not need the admin to be multilingual. Routes are excluded from I18n routing, it the name starts with an underscore.

Fatal error: Call to a member function compile() on a non-object in /Users/me/Projects/Web/htdocs/BikecityGuide/website/vendor/bundles/WhiteOctober/PagerfantaBundle/Twig/PagerfantaExtension.php on line 74

translate problem

In template:
Resources/templates/CommonAdmin/EditAction/update.php.twig

        $this->get('session')->setFlash('success', 'The object was successfully saved');

        return new RedirectResponse($this->generateUrl("{{ namespace_prefix }}_{{ bundle_name }}{{ builder.BaseGeneratorName ? "_" ~ builder.BaseGeneratorName : "" }}_edit", array('id' => ${{ builder.ModelClass }}->getId()) ));

    } else {
       $this->get('session')->setFlash('error', "The form can't be saved. Check errors and try to resubmit");

How i can translate this strings:
'The object was successfully saved'
"The form can't be saved. Check errors and try to resubmit"

{{ echo_trans( "foo" ) }} not suitable

Own fields?

Hi
Sorry for my english...
Decided to try AdmingeneratorBundles (installed AdmingeneratorIpsum). Decided use in one of my project, but can not figure out how to use own fields in EditForm.
I use Doctrine ORM.
For example:
In db has field: text_type (string)
it can be: โ€‹โ€‹html or text.
How to describe this field in generator.yml, to the EditForm that the form contains a field select (\select<\option>html</option><\option>text</option>/select). After submit form in db save selected value ('html' or 'text')...

And if not difficult. Help to figure out:

  1. How to add the File field.
  2. How to add a visual editor (wysiwyg) for text field

Namespace Problem Options

@altrano said on http://groups.google.com/group/symfony2admingenerator/browse_thread/thread/e8c2b9ea11285b71?hl=en# :

Hi i just installed The AdmingeneratorBundle.

But it will not work when i browse to the admin list action i become
the message ("Class "Bundle\BlogBundle\Controller\Blog\ListController"
does not exist."). this is correct because the class is in namespace
"AltraOne\Bundle\BlogBundle\Controller\Blog\ListController" and not in
"Bundle\BlogBundle\Controller\Blog\ListController"

I see in AdmingeneratorIpsum it uses namespace like "Admingenerator
\DemoBundle" and i think this is the problem.

How to use the Bundle with namespace "AltraOne\Bundle\BlogBundle
\Controller\Blog\ListControlle" i don't want to restructure my
project.

Hope anybody understand my problem and can help me... :-)

PS: Sorry for my bad english


I work to solve this bug

Fatal Error: app/console admin:generate-admin

I'm attempting to generate a admin bundle via the console using this
command
app/console admin:generate-admin and I'm getting this message

[ErrorException]
Catchable Fatal Error: Argument 1 passed to Admingenerator
\GeneratorBundle\Generator\BundleGenerator::__construct() must be an
instance of Symfony\Component\Filesystem\Filesystem, instance of
Symfony\Component\HttpKernel\Util\Filesystem given, called in /home/
eleconline/quotesys/vendor/bundles/Admingenerator/GeneratorBundle/
Command/GenerateAdminCommand.php on line 138 and defined in /home/
eleconline/quotesys/vendor/bundles/Admingenerator/GeneratorBundle/
Generator/BundleGenerator.php line 29

Command admin:setup fails

The command says:

Edit config.yml and configure the section admingenerator_generator like that :
admingenerator_generator:
    base_admin_template: AdmingeneratorActiveAdminThemeBundle::base_admin_assetic_less.html.twig
    use_propel: yes
    use_doctrine_orm: no
    use_doctrine_odm: no

If I do that, then I get:

[Symfony\Component\Config\Definition\Exception\InvalidTypeException]                                  
Invalid type for path "admingenerator_generator.use_doctrine_orm". Expected boolean, but got string.  

That's because you've configured boolean attributes. You should generate true instead of yes, false instead of no.

William

Primary Key named other than "id"

Wanted to open a discussion about how we want to do this. Right now a bunch of the templates have a hard coded "id" on most of the actions. For doctrine we can get the PK of the object via the following with the entity manager ($em)

$em->getMetadataFactory()->getMetaDataFor('MyBundle:MyEntity')->getSingleIdentifierFieldName()

So we could do that to get the column in doctrine. I'm not a propel user so not sure on that one.

For the templates where right now it is:

"{ 'id': " ~ builder.ModelClass ~ ".id }"

We could do something like builder.ModelPrimaryKey instead of hard coding the id. What do you think?

Propel1 in PropelDoubleListType

I'm using symfony 2.0.10 with current PropelBundle. Propel1Bundle will be added in symfony 2.1, so right I receive fatal error
Fatal error: Class 'Symfony\Bridge\Propel1\Form\Type\ModelType' not found

If You want to use Propel1 Bundle, You should create new branch, for symfony 2.1. In symfony 2.0.10 You should use

use Propel\PropelBundle\Form\Type\ModelType;

Better Trouble shooting of the generator schema

This is a general comment - nothing to debug, or troubleshoot. I am finding it slow to sort issues that are system wide. i.e. across all the components involved in the generator schema. I do recommend that integration into symfony2 profiler is really needed to show the variables used by the generator builder. Particularly with many fields and database relationships, filters, scopes and so on that are referenced by the schema. This would save lots of time moving between debugger, generated code etc. Given the builder has this data together now this might be practical.

Obviously not to 1.0 - but 1.1?

menu not working

It's probably related to some changes in knp menu bundle.
There is no element with id "main_navigation", so the menu.js script fails to execute.

Provide tests

Hi,

You should add some unit tests as this bundle is becoming more and more big. If you don't do this effort right now, it will be hard to add them in the future.

Regards,
William

Found a typo in services.xml

at line 13
Admingenerator\GeneratorBundle\Menu\DefaultMenuBuilder

must be
Admingenerator\GeneratorBundle\Menu\DefaultMenuBuilder

:-)

timestamp db type (postgresql)

How to use db type timestamp for dates and times. I have an error in its use.

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("The dbType "timestamp" is not yet implemented") in "ListBuilderAction.php.twig" at line 71.

My.orm.yml (datetime_create)

Admin\MyBundle\Entity\Text:
type: entity
table: texsts
id:
    id:
        type: integer
        generator: { strategy: AUTO }
fields:
    is_published:
        type: boolean
    datetime_create:
        type: timestamp

....

Namespace generation problem

Hi,

I'm failing using the bundle.

I got the message:

Opps an error occurred in your configuration. If you're in prod try cache:warmup

The problem is I'm in dev environment and the generate classes are wrong.

See, my bundle tree folder:

  • src
    • Billy
      • BlogBundle
      • BlogBundle.php

My generator.yml file:

generator: admingenerator.generator.propel
params:
  model: Billy\BlogBundle\Model\Post
  namespace_prefix: Billy
  bundle_name: BlogBundle
  fields: ~

builders:
  list:
    params:
      title: List for BlogBundle
      display: ~
      actions:
        new: ~
      object_actions:
        edit: ~
        delete: ~
  filters:
    params:
      display: ~
  new:
    params:
      title: New object for BlogBundle
      display: ~
      actions:
        list: ~
  edit:
    params:
      title: You're editing the object "{{ Post.title }}"
      display: ~
      actions:
        list: ~
  delete: ~

And my routing file is:

BlogBundle_admin_billy_blog_bundle_post:
    resource: "@BlogBundle/Controller/Post/"
    type:     admingenerator
    prefix:   /admin/billy_blog_bundle/post

BlogBundle:
    resource: "@BlogBundle/Controller/"
    type:     annotation
    prefix:   /

When I look up in the cache directory I go this:

  • cache
    • Admingenerated
      • BillyBlogBundle
        • BasePostController
        • Form
        • Resources
      • BlogBundle
        • BasePostController

Why 2 directories ? And why BillyBlogBundle directory as my bundle namespace is Billy\BlogBundle and my bundle name BlogBundle ?

Maybe I made something wrong but I didn't see what.

Text filter

Text filter is missing in Admingenerator\Generatorbundle\QueryFilter\DoctrineQueryFilter, every time i need to override processFilter method in ListController`s and add string filter instead of text for filtering by text.

Add a php validation for forms

Actually the form validation is in HTML5 managed by the generator and in php managed by user like in http://symfony.com/doc/current/book/validation.html#constraint-configuration, i imagine to create a proxy class chain between bundle and real model class

  • BundleYourModel extends AdmingeneratedBundleYourModel
  • AdmingeneratedBundleYourModel extends YourModel

And in AdmingeneratedBundleModel something like :

public static function loadValidatorMetadata(ClassMetadata $metadata)
    {
        parent::loadValidatorMetadata(); //If is callable

        //And auto generated
        $metadata->addPropertyConstraint('gender', new Choice(array(
            'choices' => array('male', 'female'),
            'message' => 'Choose a valid gender.',
        )));
    }

What do you think about ?

Allow to override things

Hi,

For now, generated stuffs are located in the cache directory. It's quite cool but not enough.
How can we extend things ? I don't expect a commit to close this issue right now but we could discuss about how to provide this kind of feature.

The symfony 1.x way is to reproduce the same files structure as in the cache and to deal with that on runtime.
Is there a better way to do that ? This is a an opened question..

Regards,
William

doctrine virtual file field type

Hi... I'm working with doctrine and try to implement the file uploading. I follow the intructions, how to implement own field, but always get the same error while rendering the form:

An exception has been thrown during the rendering of a template ("The dbType "virtual" is only for list implemented (column "file")") in ../CommonAdmin/EditTemplate/fieldset.php.twig at line 11.

I used such configuration for creating form fields:

new:
  fields:
    file:
      formType: file
      formOptions: []

?stop_loop=true If you're in prod try cache:warmup

I have the following structure
bundle structure

and following generator.yml

generator: admingenerator.generator.doctrine
params:
  model: Acme\Lacroco\StoreBundle\Entity\MltdCategory
  namespace_prefix: Acme
  subfolder: LacrocoBackend
  bundle_name: AcmeLacrocoBackendStoreBundle
  fields: ~

when trying to access the url i get this error with reddirect to url with param ?stop_loop=true

Opps an error occurred in your configuration. If you're in prod try cache:warmup

Make a standard API

Hi,

In order to start side projects like to implement the Propel part or something else, you should clean your interfaces and mark them as stable (what about using the @api phpdoc tag ?).

Regards,
William

Twig Fieldsets issue

I get the following error when setting up field sets for the Edit and New actions.
In the generator yaml file, we have:
edit:
params:
title: Edit {{ Profile.firstname }} {{ Profile.lastname }}
display:
NONE: [[ firstname,Middleinit,lastname] , Address1,Address2,city,state,country,phone, email ]

I get this error:
An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in /apps/sites/Ipsum/vendor/bundles/Admingenerator/GeneratorBundle/Builder/Admin/BaseBuilder.php line 170") in ../CommonAdmin/EditTemplate/form.php.twig at line 16.

"Admingenerated" namespace not generated

In my generated controllers eg. listController, it inherits from a BaseListController.

The generated controller file contains the use statement:

use Admingenerated...\BaseController\NewController as BaseListController;

However, the "Admingenerated" namespace was not generated - so where are all the base classes supposed to be?

Thanks.

Decouplate bundles

Hi,

As your bundle is a fucking good one and does an awesome work, you should separate the two bundles in that one.

Regards,
William

Change vendor namespace and composer vendor

It's me again, because this hasn't been fixed yet, and waiting only makes it worse.

The "Admingenerator" namespace makes no sense, and the "admin" one is also meaningless. If you really want to keep the namespace, even though I think it's wrong, fine; but please change the package vendor to be something else and resubmit it on packagist.

Bundle too close to doctrine

I can't run the admin:setup command if I don't have a Doctrine oriented project.

Reason the default value for use_doctrine is true in the Configuration class. Turn this value to false by using defaultFalse() solves the bug.

Bug or Not?

i started a new fun project and generate the Admin.

but i become an error that says

An exception has been thrown during the rendering of a template ("Warning: array_merge(): Argument #2 is not an array in /home/altrano/Projekte/AltraTwo/vendor/bundles/WhiteOctober/PagerfantaBundle/Twig/PagerfantaExtension.php line 73") in Admingenerated/AltraTwoBlogBundle/Resources/views/PostList/index.html.twig at line 276.

i do all the same like in the older project with working Admin, i dont understand that.

helps, solutions .... :-)

allow all namespace/bundle configurations

this is related to #46

Bundle/namespace option should be able to handle any configuration, not only with one subfolder absent from the bundle name.

There should be One option for full Namespace and one for bundlename.

If I have time I will make a PR

Ideas

The Admingenerator is absolutely fantastic, so easy to use.

After using AdminGenerator for a while, I've made a list of some ideas which might make this great product even better:

- Replace default markup withTwitter Bootstrap markup and classes (because many free css themes are coming out which will be support bootstrap markup and classes, eg. - http://bootswatch.com/)

loostro: feat-twitter-theme solves

- provide way to configure and generate multiple menus/submenus

loostro: added in feat-twitter-theme branch

- add a "Save and Create Another" action for repeated creates without returning to list each time - very useful.

loostro: added in feat-twitter-theme branch

  • easier way to specify a sort on the records in dropdowns without having to override the formType

[Use i18n_catalog] - allow specification of translation catalog per bundle

loostro: i18n_catalog can be specified in each generator, if you specify the same catalog in each file, you've got one i18n_catalog for the whole bundle

- add a twig block around the submit button, so it can be overridden without having to take the entire template. [DONE b9c8466 ]

- change list layout, put filters on top so can have more fields in table without pushing the filter box down underneath the table (it's not so practical now, a wide table will always push down the filter box).

loostro: moved to twitter-theme todo list, will be part of RC1 or will be done right after RC1

- incorporate JQuery widgets (date picker, autocomplete, other useful form widgets)

loostro: feat-twitter-theme branch introduces new widgets (datepicker, entity picker, upload, collection)

- markdown for text areas

loostro: markdown requires your users to learn it's syntax, which for us (webdevelopers) is nothing hard, but most of our clients will require a WYSIWYG. I discussed adding WYSIWYG into admingenerator with cerdic and we decided it's not something that should be part of Admingenerator. Anyways.. I will add creating doc on "how to connect WYSIWYG/markdown editor with Admingenerator" to my TODO list.

- autogenerate image upload field and association with a model.

loostro: upload widget in feat-twitter-theme offers previews and supports multiple file uploads, also can restrict upload to only given mimetypes or file extensions

- batch actions [DONE c7717e7]

loostro: moveing all other ideas to #237 to keep TODO in one place & closeing this issue

  • generated functional tests for each entity
  • configure field display types (checkboxes, radio buttons, multi-select)
  • autogenerate a MyPrefix_generator.yml for each entity (since we already know all the fields - we can always delete fields we don't want)

[DONE FOR PROPEL] - handle nested sets (ie. heirarchies/Trees).

  • single command which generates all admins for all entities in a bundle at once, with all fields in the generator.yml already filled in with default values. So - one command and an entire admin section appears for the entire site. You just go in and tweak.

and of course you already know about:

  • chained admin's (product has related images, comments, subproducts, etc.)

Windows Compatibility

Hi Cedric,

Could you make your bundle compatible with windows ?

the symlink should be real path :

Resources/templates/Doctrine/CommonAdmin

There is also an issue in the routing loader (need to replace \ by /)

And it would be easier to have generated css file

Error while trying to run > php app/console admin:setup

Coming from this Issue reported by mistake here https://github.com/cedriclombardot/AdmingeneratorActiveAdminThemeBundle/issues/11#issuecomment-2778853:

Maybe this is not a issue but didn't know where to ask this. I follow every step at docs for install the Bundle but get this error:

Fatal error: Interface 'Pagerfanta\View\ViewInterface' not found in D:\Webserver\htdocs\hospedaje\vendor\bundles\Admingenerator\GeneratorBundle\Pagerfanta\View\AdmingenratorView.php on line 10

when trying to run the command >php app/console admin:setup, any help on this? What I'm doing wrong?

PS: Any list or forum or groups to post this problems?
Cheers and thx

And in reply to @cedriclombardot I have all fine as defined in my autoload.php (only relevant parts):

$loader->registerNamespaces(array(
'Symfony' => array(DIR . '/../vendor/symfony/src', DIR . '/../vendor/bundles'),
'Sensio' => DIR . '/../vendor/bundles',
'JMS' => DIR . '/../vendor/bundles',
'Doctrine\Common\DataFixtures' => DIR . '/../vendor/doctrine-fixtures/lib',
'Doctrine\Common' => DIR . '/../vendor/doctrine-common/lib',
'Doctrine\DBAL' => DIR . '/../vendor/doctrine-dbal/lib',
'Doctrine' => DIR . '/../vendor/doctrine/lib',
'Monolog' => DIR . '/../vendor/monolog/src',
'Assetic' => DIR . '/../vendor/assetic/src',
'Metadata' => DIR . '/../vendor/metadata/src',
'Knp\Bundle' => DIR . '/../vendor/bundles',
'Knp\Menu' => DIR . '/../vendor/knpmenu/src',
'FOS' => DIR . '/../vendor/bundles',
'Sonata' => DIR . '/../vendor/bundles',
'CG' => DIR . '/../vendor/cg/src',
// Solo para AcmePizzaBundle
'Acme' => DIR . '/../vendor/bundles',
// AdminGenerator
'Admingenerator' => array(DIR.'/../src', DIR.'/../vendor/bundles'),
'WhiteOctober\PagerfantaBundle' => DIR.'/../vendor/bundles',
'Pagerfanta' => DIR.'/../vendor/pagerfanta/src',
));

And AppKernel.php
public function registerBundles() {
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\BluePrintBundle\SonataBluePrintBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
// Admin Generator
new Admingenerator\GeneratorBundle\AdmingeneratorGeneratorBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
// Theme for AdminGenerator
new Admingenerator\ActiveAdminThemeBundle\AdmingeneratorActiveAdminThemeBundle(),
new Albet\HospedajeBundle\AlbetHospedajeBundle(),
);

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
    }

    return $bundles;
}

Error in MongoDB types

I'm trying to create an admin for The User document in FosUserBundle. That document has a "role" attribute that the type is "hash"
And when the admin controller tries to show the page , it'll throw

An exception has been thrown during the rendering of a template ("The dbType "hash" is not yet implemented") in "ListBuilderAction.php.twig" at line 73. 

"Expected argument of type "object or array"

hello,
I've tried to find the problem for this error but without lucky. Some has happened with the content in my db that sometimes when twig want render the template throw this error.

An exception has been thrown during the rendering of a template ("Expected argument of type "object or array", "NULL" given").

I'm sure that is because some strange data in my db. If anybody can help me....

Thanks in advance !

Create a group in Google Groups for asking about doubts

Hi cedriclombardot, will be nice if you can create a group in Google Groups because I'm having some doubts and doesn't know where to ask because I think here at Github is not the proper place to ask question about configuration or generation for more than one model or some others. What you think?

Missing Manual

Is there any document about how to start using the bundle ?

Problems with filtering

I have a entity Dealers with two referencing manyToOne:

  • partners
  • city

Dealers.orm.yml:

 ...\Entity\Dealers:
type: entity
table: dealers
repositoryClass: ...\Entity\DealersRepository 
id:
    id:
        type: bigint
        generator:
            strategy: IDENTITY
fields:

....

manyToOne:
  partner:
    targetEntity: ...\Entity\Partners
  city:
    targetEntity: ...\Entity\Cities

Partners.orm.yml:

  ....
 oneToMany:
       dealers:
           targetEntity: ...\Entity\Dealers
           mappedBy: partner
  ....

Cities.orm.yml:

  ....
 oneToMany:
       dealers:
           targetEntity: ...\Entity\Dealers
           mappedBy: city
  ....

dealers-generator.yml:

 ...  
generator: admingenerator.generator.doctrine
 params:
    model: ...\Entity\Dealers
    fields: 
    ...
    partner:
        label: Partner
        getter: partner.title
        addFormOptions:
            property: title
    city:
        label: City
        getter: city.title
        addFormOptions:
            property: title
builders:
   filters:
       params:
            fields:
            display: [ is_published, address, partner, city ]
 ...

and I decided to add the ability to filter the list of dealers in these fields.

Without error operates only on filtration by "partners".
When I try to filter by "city" field, getting a few exceptions, the first of them:

ErrorException: Notice: serialize() [function.serialize]: "id" returned as member variable from __sleep() but does not exist in    .../vendor/symfony/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php line 29

Further more the exception list (28) different classes:

Exception: ClassName:: serialize () must return a string or NULL

Have any ideas how to fix it?

error in updating document

I made an admin for on of my models with ReferenceMany relation. Some times the edit admin module is working fine , but in some cases I recive "The form can't be saved. Check errors and try to resubmit " message

any idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.