This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Several Admin (generator.yml) within the same module

Notes and reports about symfony 1.0.x stable

Several Admin (generator.yml) within the same module

by Ciezo » Mon Feb 07, 2011 2:43 pm

Hi everyone!!

I've started to play with a symfony web application and i find it incredible!!! Well, I'll try to explain what I want to do:

I have a module with, let's say, 30 possible DB fields. Depending on a request parameter I want to show only some of these fields and continue using my generator.yml, is there any easy way to do it??

Thanks a lot!
Ciezo
Junior Member
 
Posts: 5
Joined: Mon Feb 07, 2011 2:21 pm

Re: Several Admin (generator.yml) within the same module

by woolfas » Mon Feb 07, 2011 3:40 pm

Well, I do not know how it works in symfony version 1.0, but in version 1.4 the "display" option does the trick. See this generator.yml configuration reference for details:
http://www.symfonyreference.com/generator-yml
hope that will help
User avatar
woolfas
Member
 
Posts: 61
Joined: Mon Nov 08, 2010 2:31 pm
Location: Lithuania

Re: Several Admin (generator.yml) within the same module

by Ciezo » Mon Feb 07, 2011 6:05 pm

woolfas wrote:Well, I do not know how it works in symfony version 1.0, but in version 1.4 the "display" option does the trick. See this generator.yml configuration reference for details:
http://www.symfonyreference.com/generator-yml
hope that will help


Hi woolfas, thanks for the answer.

As I only have 1 generator.yml for my model class, I don't know how to "split" or "separate" and print some displays if 'request parameter = 1' and other displays if 'request parameter = 2'.

Imagine I have this generator.yml

generator:
class: sfPropelAdminGenerator
param:
model_class: Photo
theme: default
list:
display: [file_path, description, created_at]
object_actions:
_edit:
name: Edit picture properties


And depending on a, for example, request parameter, i want to print only file_path or only description. Is it possible to do with administration generator?

I'm not sure if the explanation is clear enough...

Thanks, Tomas.
Ciezo
Junior Member
 
Posts: 5
Joined: Mon Feb 07, 2011 2:21 pm

Re: Several Admin (generator.yml) within the same module

by woolfas » Mon Feb 07, 2011 10:05 pm

I don't think, that generator supports this.. The only way to do that is to override templates..
User avatar
woolfas
Member
 
Posts: 61
Joined: Mon Nov 08, 2010 2:31 pm
Location: Lithuania

Re: Several Admin (generator.yml) within the same module

by Ciezo » Tue Feb 08, 2011 11:35 am

Hi Woolfas, thanks for your interest!

This is how I've resolved my conflict: I've created 2 different Administration Modules for the same obect, this way I have 2 generator.yml and I can choose which fields I want to display.

Greetings, Tomas.
Ciezo
Junior Member
 
Posts: 5
Joined: Mon Feb 07, 2011 2:21 pm