コード例 #1
0
ファイル: InflectorTest.php プロジェクト: titon/utility-old
 /**
  * Test that camelCase() returns strings as camel case.
  */
 public function testCamelCase()
 {
     $camelCase = array('foo Bar', 'fOo Bar', 'foo_Bar', ' foo-_--_BAR', 'foo-BAR', 'FOO-BAR', 'foo     bar   ');
     foreach ($camelCase as $value) {
         $this->assertEquals('FooBar', Inflector::camelCase($value));
     }
 }
コード例 #2
0
ファイル: bootstrap.php プロジェクト: titon/utility-old
 function camel_case($string)
 {
     return Inflector::camelCase($string);
 }
コード例 #3
0
ファイル: Model.php プロジェクト: titon/model
 /**
  * Check to see if a mutator method exists on the current model.
  * If so, return the method name, else return null.
  *
  * @param string $field
  * @return string
  */
 public function hasMutator($field)
 {
     $method = sprintf('set%sAttribute', Inflector::camelCase($field));
     if (method_exists($this, $method)) {
         return $method;
     }
     return null;
 }