當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Inflector::hyphenToUnderscore方法代碼示例

本文整理匯總了PHP中Inflector::hyphenToUnderscore方法的典型用法代碼示例。如果您正苦於以下問題:PHP Inflector::hyphenToUnderscore方法的具體用法?PHP Inflector::hyphenToUnderscore怎麽用?PHP Inflector::hyphenToUnderscore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Inflector的用法示例。


在下文中一共展示了Inflector::hyphenToUnderscore方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: normalize

 protected static function normalize($request)
 {
     if (is_null($request)) {
         $request = Mapper::parse();
     }
     $request['controller'] = Inflector::hyphenToUnderscore($request['controller']);
     $request['action'] = Inflector::hyphenToUnderscore($request['action']);
     return $request;
 }
開發者ID:spaghettiphp,項目名稱:spaghettiphp,代碼行數:9,代碼來源:Dispatcher.php

示例2: dispatch

 /**
  *  Chama o controller e a action solicitadas pela URL.
  * 
  *  @return mixed Instância do novo controller ou falso em caso de erro
  */
 public function dispatch()
 {
     $path = Mapper::parse();
     $path["controller"] = Inflector::hyphenToUnderscore($path["controller"]);
     $path["action"] = Inflector::hyphenToUnderscore($path["action"]);
     $controller_name = Inflector::camelize($path["controller"]) . "Controller";
     if ($controller =& ClassRegistry::load($controller_name, "Controller")) {
         if (!can_call_method($controller, $path['action']) && !App::path("View", "{$path['controller']}/{$path['action']}.{$path['extension']}")) {
             $this->error("missingAction", array("controller" => $path["controller"], "action" => $path["action"]));
             return false;
         }
     } else {
         if (App::path("View", "{$path['controller']}/{$path['action']}.{$path['extension']}")) {
             $controller =& ClassRegistry::load("AppController", "Controller");
         } else {
             $this->error("missingController", array("controller" => $path["controller"]));
             return false;
         }
     }
     $controller->params = $path;
     $controller->componentEvent("initialize");
     $controller->beforeFilter();
     $controller->componentEvent("startup");
     if (in_array($path["action"], $controller->methods) && can_call_method($controller, $path["action"])) {
         $params = $path["params"];
         if (!is_null($path["id"])) {
             $params = array_merge(array($path["id"]), $params);
         }
         call_user_func_array(array(&$controller, $path["action"]), $params);
     }
     if ($controller->autoRender) {
         $controller->render();
     }
     $controller->componentEvent("shutdown");
     echo $controller->output;
     $controller->afterFilter();
     return $controller;
 }
開發者ID:vfeitoza,項目名稱:spaghettiphp,代碼行數:43,代碼來源:dispatcher.php

示例3: tagButton

 /**
  * Centraliza a criação de botões. Pode ser um submit, um reset ou button
  *    
  * @param string $type_field Tipo do botão a ser criado. Pode ser submit, button ou reset
  * @param string $name_field O nome do botão
  * @return $this
  */
 public function tagButton($type_field, $name_field)
 {
     $this->input($type_field, $name_field, false);
     $this->attr('value', Inflector::humanize($name_field))->attr('id', Inflector::hyphenToUnderscore(Inflector::slug($name_field)))->attr('name', Inflector::hyphenToUnderscore(Inflector::slug($name_field)));
     return $this;
 }
開發者ID:klawdyo,項目名稱:spaghettiphp,代碼行數:13,代碼來源:XformHelper.php


注:本文中的Inflector::hyphenToUnderscore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。