コード例 #1
0
 public function testSlugify()
 {
     $this->assertEquals('sensio', Jobs::slugify('Sensio'));
     $this->assertEquals('sensio-labs', Jobs::slugify('sensio labs'));
     $this->assertEquals('sensio-labs', Jobs::slugify('sensio   labs'));
     $this->assertEquals('paris-france', Jobs::slugify('paris,france'));
     $this->assertEquals('sensio', Jobs::slugify('  sensio'));
     $this->assertEquals('sensio', Jobs::slugify('sensio  '));
     $this->assertEquals('n-a', Jobs::slugify(''));
     $this->assertEquals('n-a', Jobs::slugify(' - '));
     if (function_exists('iconv')) {
         $this->assertEquals('developpeur-web', Jobs::slugify('Développeur Web'));
     }
 }
コード例 #2
0
 /**
  * @ORM\PrePersist
  */
 public function setSlugValue()
 {
     $this->slug = Jobs::slugify($this->getName());
 }
コード例 #3
0
ファイル: Job.php プロジェクト: smerth/Symfony_Application
 public function getLocationSlug()
 {
     return Jobs::slugify($this->getLocation());
 }