Ejemplo n.º 1
0
 public static function requireDependency($layer, $dependency, $relativeTo = null)
 {
     list($subdir, $class) = self::dependencySubDir($dependency, $relativeTo);
     $path = APP_DIR . "/{$layer}/{$subdir}" . SInflection::underscore($class) . '.php';
     if (!file_exists($path)) {
         throw new SException("Missing " . SInflection::singularize($layer) . " {$dependency}");
     }
     require_once $path;
 }
 /**
  * Converts the class name from something like "WeblogController" to "weblog"
  */
 public function controllerName()
 {
     return SInflection::underscore(str_replace('Controller', '', $this->controllerClassName()));
 }
Ejemplo n.º 3
0
 function testUnderscore()
 {
     $this->assertEqual('my_test_controller', SInflection::underscore('MyTestController'));
     $this->assertEqual('s_my_test_controller', SInflection::underscore('SMyTestController'));
 }