Skip to content

Instantly share code, notes, and snippets.

@coma
Created March 20, 2013 16:06
Show Gist options
  • Save coma/5205920 to your computer and use it in GitHub Desktop.
Save coma/5205920 to your computer and use it in GitHub Desktop.
Idea para solucionar el problema de los plurales en castellano para Symfony.
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Doctrine\Common\Inflector\Inflector;
class AppKernel extends Kernel
{
public function __construct($environment, $debug)
{
Inflector::rules('singular', [
'/(d|n|r|s)es$/i' => '\1\2',
'/(sis)$/i' => '\1\2',
'/([ti])a$/i' => '\1a',
]);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment