On Tue, Feb 19, 2013 at 06:40:42AM -0800, Ally Burns wrote:
> I've seen a few other Symfony bundles with bundles containing slugify e.g.
>
>
https://packagist.org/packages/deruwe/slugify-bundle
>
> Which is really just a wrapper for:
>
https://github.com/cocur/slugify/blob/master/src/Cocur/Slugify/Slugify.php
>
>
> I'm sure there was another bundle with a number of string tools including
> slugify. The others looks useful to a cms too.
>
> What are peoples thoughts on a 3rd party for such things like slugify? Is it
> too basic a function to introduce more 3rd party bundles?
>
> At what point do we think it's best to keep code "in house" o avoud introducing
> more requirements for a few lines of code?
>
> Cheers,
>
> Ally
I think one of the difficult things with a Urlizer/Slugifier is that
there seem to be lots of different ways of implementing it, and I'm not
sure all slugifiers support, for e.g., russian characters. So I think it
is important to allow the end-user to choose. Rather than assume that we
cover all the cases.
Another thing I notice is that at least one of the available slugifiers
removes words like "and, is, this" etc. which I wouldn't do, but it goes
to show that there are different needs.
In this PR I have added a SlugifierInterface and a CallbackSlugifier,
which effectively allows you to use any third party slugifier:
https://github.com/symfony-cmf/RoutingExtraBundle/pull/69
Probably not the ideal solution, or place for it to go.
>
>
>
>
>
>
>
>
>
>
> On Sunday, February 17, 2013 5:14:22 PM UTC, dantleech wrote:
>
> Hi,
>
> In the BlogBundle I have created a PostUtil class with a single method,
> slugify(), which I am now reusing in another bundle.
>
> In both cases it is to generate change a Title into a URL slug for routing,
> which would incidentally be solved by
>
https://github.com/symfony-cmf/RoutingExtraBundle/issues/68 and I guess
> would be useful for that.
>
> It seems to me that this is a pretty useful thing to have, especially
> for routing, and that it should probably also be a service
> (like
https://github.com/FabienPennequin/FPNTagBundle/blob/master/Util/
> Slugifier.php)
>
> Should this be in the CMF? Should it be in CoreBundle (or routing
> component / bundle)? and what is the aim of core bundle anyways? at the
> moment
> it could well be called PublishWorkflowBundle :)
>
> Cheers
>
> Dan
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony-cmf-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to
symfony-cmf-de...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>