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
public function __toString() { | |
try { | |
return $this->call(); | |
} catch(\Exception $e) { | |
// the __toString method isn't allowed to throw exceptions | |
// so we turn them into an error instead | |
trigger_error($e->getMessage() . "\n" . $e->getTraceAsString(), E_USER_ERROR); | |
return ''; | |
} | |
} |
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
<?php | |
namespace Your\Bundle\Misc; | |
class SluggableListener extends \Gedmo\Sluggable\SluggableListener | |
{ | |
public function __construct(){ | |
$this->setTransliterator(array('\Your\Bundle\Misc\Transliterator', 'transliterate')); | |
} |