Add function for URL slug
Add function for URL slug
Hello,
I'm using Editor as a custom CMS, and I've being trying to figure out how to add a function that will create URL slugs. I would like to use either of these:
https://github.com/jbroadway/urlify
https://github.com/jbroadway/urlify/blob/master/URLify.php
but I'm not at all sure how to integrate them with Editor as a simple function that can be called from Editor js file.
Any ideas would be appreciated.
Thanks
This discussion has been closed.
Replies
In addition to my question, I thought that perhaps I can make a custom class using URLify.php, similar to the Format class, and call it in the config file, using a function such as getFormatter. Something like:
but I have not gotten further than simply thinking of this, I'm not sure how to implement.
Try using a closure function as the get formatter - that way you can call virtually any function to do the formatting inside the closure.
Allan