Example #1
0
 /**
  * Automatic routing
  */
 public function __call($method, $parameters)
 {
     // Get view name
     $view = preg_replace("/([a-z]+)([A-Z][a-z]+)/", '$2', $method);
     $view = $this->page . '.' . String::lower($view);
     // Return view if found
     try {
         $exists = View::getFinder()->find($view);
     } catch (InvalidArgumentException $e) {
         $exists = false;
     }
     if ($exists) {
         return View::make($view);
     }
     // Else throw a 404
     return parent::__call($method, $parameters);
 }
Example #2
0
 public function testCanConvertToLowercase()
 {
     $this->assertEquals('taylor', String::lower('TAYLOR'));
     $this->assertEquals('άχιστη', String::lower('ΆΧΙΣΤΗ'));
 }