phpcr-odm icon indicating copy to clipboard operation
phpcr-odm copied to clipboard

[WIP] Field slugifier id generator

Open dantleech opened this issue 10 years ago • 4 comments

Just an idea of how this might work.

dantleech avatar Dec 22 '14 17:12 dantleech

After some reflection I think if anything this should be about normalization and not slugification. After all it is perfectly valid to have spaces and non-url-safe characters in a node name.

dantleech avatar Dec 24 '14 12:12 dantleech

hey, cool. i think this is almost ready.

agree that this could be called NormalizedFieldIdGenerator or something. when you want to use the path in a URL, you do want it to be slugified. otherwise you want potentially unsupported characters replaced. and in all cases, you must translate / and the other forbidden characters in a name. documentation should be clear about that. we could provide a very simple normalizer by default that just replaces /:[]|* with -.

dbu avatar Dec 27 '14 14:12 dbu

that default normalizer could also get us rid of adding a dependency for a slugifier. we can then explain how to use that instead of the default normalizer in the doc.

dbu avatar Dec 27 '14 14:12 dbu

@dantleech something for an upcoming phpcr-odm 2.0? or should we drop this and leave it to other layers of the application to generate ids?

dbu avatar Jun 20 '16 12:06 dbu