These are chat archives for symfony2admingenerator/GeneratorBundle

15th
Apr 2015
ioleo
@ioleo
Apr 15 2015 10:56
@matejvelikonja
            tabs: 
                "tab.user":
                    "set.general":    
                        - [ firstName, lastName ]
                        - [ username, email ]
                        - [ plainPassword ]
                    "set.status":
                        - [ enabled, locked, expired, visible ]
                "tab.security":
                    "set.roles":
                        - [ roles ]
                    "set.groups":
                        - [ groups ]
ofcourse, tab.user, set.general ETC are translation keys
they will be translated useing the i18n_catalog: MyDemoBundle
you can also directly define tab/set names in generator.yml

like this

@matejvelikonja

            tabs: 
                "User":
                    "General":    
                        - [ firstName, lastName ]
                        - [ username, email ]
                        - [ plainPassword ]
                    "Status":
                        - [ enabled, locked, expired, visible ]
                "Security":
                    "Roles":
                        - [ roles ]
                    "Groups":
                        - [ groups ]
@bobvandevijver see example above, set.general, this is an array of rows... so it's keys will be numeric
"set.general":    
    - [ firstName, lastName ]
    - [ username, email ]
    - [ plainPassword ]
so the col-md-4 class will be given as a default (meaning that 3 fields/per row fit, becouse bootstrap's grid is divided into 12 units)
ioleo
@ioleo
Apr 15 2015 11:02
@bobvandevijver
"set.general":    
    "row1 col-md-12": [ firstName, lastName ]
    "row2 col-md-9": [ username, email ]
    "row3 col-md-12": [ plainPassword ]
in this config, the array keys are non-numeric (they are strings)
which means that these strings will be used as class names
Note: that I added "rowX" to each string. This is becouse an array cannot have 2 items with the same key. Without this prefix - row3 would overwrite row1:
"set.general":
    "col-md-12": [ firstName, lastName ]
    "col-md-9": [ username, email ]
    "col-md-12": [ plainPassword ] # the key "col-md-12" already exists! this will overwrite the first row!
Bob van de Vijver
@bobvandevijver
Apr 15 2015 11:12
Ok, I will try that later today or tomorrow, thanks
Dražen Perić
@peric
Apr 15 2015 15:42
hey @loostro, one question...I've updated admingenerator bundle to latest master version, but I get...
[Symfony\Component\Debug\Exception\ContextErrorException]
Notice: Undefined property: Admingenerator\GeneratorBundle\Generator\DoctrineGenerator::$container
Any idea about that? I get it during cache clear
Or maybe someone else will also know :)
ioleo
@ioleo
Apr 15 2015 15:50
there should not be any dependency on container anymore
ahh fuck
kernel ><
ioleo
@ioleo
Apr 15 2015 15:58
@peric thanks for reporting, #141 should fix that
Dražen Perić
@peric
Apr 15 2015 15:59
alright, thank you :) will try it out.
Dražen Perić
@peric
Apr 15 2015 16:35

I have one more problem here - and this worked before.

After trying to load an admin, I get this msg:

"An exception has been thrown during the rendering of a template ("0") in AdmingeneratorGeneratorBundle:Navbar:authenticated.html.twig at line 18."

Any idea? I don't see any updates to this file.

ioleo
@ioleo
Apr 15 2015 16:39
That line uses the Twig ConfigExtension which recently was updated (removed container dependency)
the array should contain all "admingenerator" configuration params
could you echo/dump what you have in this array?
do you have the exit_route defined?
Matej Velikonja
@matejvelikonja
Apr 15 2015 17:16
@loostro thx for the tabs confif, it works!
ioleo
@ioleo
Apr 15 2015 17:17
i'm really pissed off that I have had not enough time yet to write a proper doc :/