cakephp-sluggable | CakePHP 3.x that enables | Plugin library
kandi X-RAY | cakephp-sluggable Summary
kandi X-RAY | cakephp-sluggable Summary
Plugin for CakePHP 3.x that enables automatic, configurable slugging of database fields
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handles the afterSave event .
- Generates a value based on a pattern
- Generate the slug for an entity
- Find slugs for slugs .
- Custom finder for slugs .
cakephp-sluggable Key Features
cakephp-sluggable Examples and Code Snippets
Community Discussions
Trending Discussions on cakephp-sluggable
QUESTION
I need two improvements for my slugs:
Removing special characters.
Converting vowels with accent marks to vowels without accent marks.
The problem is that my website is generating URLs with slugs such as:
https://example.net/Toronto/product/férula-dental-limpieza-con-ul
https://cuponclub.net/Toronto/product/lifting-de-pestañas
Those special characters such as "é" and "ñ" in the URL tend to be problematic for me for many different reasons such as when I integrate URLs to APIs that I use or even when sharing links...
I am using CakePHP 1.2
. This is how I implement the slugs in the code:
ANSWER
Answered 2018-Nov-06 at 13:42Given that the plugin that you are using hasn't had any updates in the last 10 years, I would say it's safe to assume that maintaining it yourself is your best option - if you don't want to create a behavior from scratch that is, wich shouldn't be very hard to do either
So, just fork it and make the required changes or create a custom behavior. I would also suggest to have a look at how the latest CakePHP handles this, see the source for \Cake\Utility\Text::slug()
. If your PHP installation supports it, then you may want to backport this, ie make use of PHPs transliteration functionality provided by the INTL extension.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cakephp-sluggable
Composer Install
Manual Install
Loading the plugin in your app
Setting up the namespace / autoloader
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page