コード例 #1
0
ファイル: Handle.php プロジェクト: hiroki-ta/my.project
 /**
  *  Ethna_Handle constructor (stub for php4)
  *
  *  @access public
  */
 public function __construct($controller, $type, $name)
 {
     parent::__construct($controller, $type, $name);
     $id = $name;
     $id = preg_replace('/^([A-Z])/e', "strtolower('\$1')", $id);
     $id = preg_replace('/([A-Z])/e', "'-' . strtolower('\$1')", $id);
     $this->id = $id;
 }
コード例 #2
0
ファイル: Handle.php プロジェクト: ethna/ethna-cli
 /**
  *  Ethna_Handle constructor (stub for php4)
  *
  *  @access public
  */
 public function __construct($controller, $type, $name)
 {
     parent::__construct($controller, $type, $name);
     $id = $name;
     $id = preg_replace_callback('/^([A-Z])/', function (array $matches) {
         return strtolower($matches[1]);
     }, $id);
     $id = preg_replace_callback('/([A-Z])/', function (array $matches) {
         return '-' . strtolower($matches[1]);
     }, $id);
     $this->id = $id;
 }