Question

I need to edit primary keys in several tables.

By default, symfony hides primary keys in New/Edit forms.

For example, can't edit table 'Tags' with only field 'tag' which is PK. Adding integer ID to this table is not exactly good db design.

Thanks in advance for your help.

Was it helpful?

Solution

As stated by @Raise, the simple solution to this is to create an updatable 'ID' field to work alongside the primary key field which you can leave well alone.

OTHER TIPS

As you say, by "default" symfony hides the primary keys.

As such, you will need to modify the generator.yml to include the specific fields you need, and possibly force the type of the fields to 'text' so they do not render as 'plain'.

If this doesn't work, you can always extend the generator.yml to include pseudo fields for these primary key fields.

As an aside, integer auto-increment primary keys are very useful, and the general feeling is against you :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top