Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🎸

Rémi T'JAMPENS tjamps

💭
🎸
  • France
View GitHub Profile
@tjamps
tjamps / slugify.php
Last active Mar 7, 2020
URL Slugs in PHP (with UTF-8 and Transliteration Support)
View slugify.php
<?php
function slugify(string $input): string
{
$transliterated = transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $input);
return trim(preg_replace('/[^a-z0-9]+/', '-', $transliterated), '-');
}
$string = 'Hello, World!';
@tjamps
tjamps / README.md
Last active Oct 12, 2020
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
View README.md

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

You can’t perform that action at this time.