Last active
January 27, 2016 18:20
-
-
Save vallieres/7f8fef7d8de3d3e422ce to your computer and use it in GitHub Desktop.
Simple API Endpoint That Uses Cocur/Slugify to Transform the Title of Artilces, , all the details on https://hipsterpixel.co/2016/01/27/my-blog-publishing-workflow-on-ios-part-1-tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'vendor/autoload.php'; | |
use Cocur\Slugify\Slugify; | |
/* This goes inside your API function */ | |
header('Content-Type:text/plain'); | |
$slugify = new Slugify(); | |
echo $slugify->slugify($string); | |
/* | |
"A Great Article" will become "a-great-article" | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment