当前位置: 首页>>代码示例>>PHP>>正文


PHP String::camelize方法代码示例

本文整理汇总了PHP中String::camelize方法的典型用法代码示例。如果您正苦于以下问题:PHP String::camelize方法的具体用法?PHP String::camelize怎么用?PHP String::camelize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在String的用法示例。


在下文中一共展示了String::camelize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 function initialize(&$request)
 {
     parent::initialize($request);
     $roleId = $request->getUserVar('roleId');
     assert(is_numeric($roleId));
     $this->setRoleId($roleId);
     if ($request->getUserVar('title')) {
         $title = $request->getUserVar('title');
     } else {
         $role =& new Role($roleId);
         $title = $role->getRoleName();
     }
     // Need a unique ID for each group listbuilder
     $this->setId($this->getId() . '-' . String::camelize(Locale::translate($title)));
     // Basic configuration
     $this->setTitle($title);
     $this->setSourceTitle('manager.setup.roleName');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_TEXT);
     // Free text input
     $this->setListTitle('manager.setup.currentRoles');
     $this->setAttributeNames(array('manager.setup.roleAbbrev'));
     $this->_loadList($request);
     $this->addColumn(new GridColumn('item', 'manager.setup.roleName'));
     $this->addColumn(new GridColumn('attribute', 'manager.setup.roleAbbrev'));
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:25,代码来源:UserGroupListbuilderHandler.inc.php

示例2: log

	function log($priority, $message, $file = null, $line = null, $e = null) {
		$schema = "DEFAULT";
		$table = "logs";
		$trace = "";
		if (!empty($e)) {
			$trace = $e->getTraceAsString();
		}
		if (is_object($message)) {
			$message = JSON::encode($message);
		}
		$now = new Date();
		$log = array();
		$log["priority"] = $priority;
		$log["message"] = $message;
		$log["trace"] = $trace;
		$log["file"] = $file;
		$log["line"] = $line;
		$log["createdBy"] = "SYS";
		$log["createdTime"] = $now;
		$log["updatedBy"] = "SYS";
		$log["updatedTime"] = $now;

		$driver = $GLOBALS["CFG_DB"]->CON[$schema]->DRIVER;
		$insert = new Insert($table, $log, $schema);
		$link = DB::connect();
		$success = mysql_query($insert->sql(), $link);
		if (!$success) {
			$result = Bean::invoke(String::camelize('_'.$driver.'_driver'), "error", array($schema));
			throw new Exception("Cannot persist object. ".$result);
		}
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:31,代码来源:Log.php

示例3: valueString

	function valueString() {
		reset($this->meta);
		$values = array();
		while(list(,$meta) = each($this->meta)) {
			$value = Bean::get($this->value, String::camelize($meta["name"]));
			$values[] = $this->escape($value, $meta["name"]);
		}
		return implode(', ', $values);
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:9,代码来源:Insert.php

示例4: listen

	function listen() {
		$pathInfo = Apu::fetchPath();
		$className = String::camelize("_".$pathInfo["class"]."_action");
		reset($GLOBALS["CFG_ACTION"]->NS);
		foreach ($GLOBALS["CFG_ACTION"]->NS as $ns) {
			Apu::import($ns.'/'.$className.".php");
		}
		$action = new $className($pathInfo["method"]);
		$action->listen();
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:10,代码来源:apu.php

示例5: delete

	function delete($table, $obj, $schema = "DEFAULT") {
		$driver = $GLOBALS["CFG_DB"]->CON[$schema]->DRIVER;
		$objId = Bean::get($obj, "__ID__");
		if (empty($objId)) {
			throw new Exception("Cannot delete unpersisted object");
		}
		$delete = new Delete($table, $obj, $schema);
		$success = DB::query($delete, $schema);
		if (!$success) {
			$result = Bean::invoke(String::camelize('_'.$driver.'_driver'), "error", array($schema));
			throw new Exception("Cannot delete object. ".$result);
		}
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:13,代码来源:DB.php

示例6: delegate

	private function delegate() {
		$controller = String::camelize($this->map['controller']) . 'Controller';
		
		if (!class_exists($controller)) {
			trigger_error("Route Error: The class `{$controller}` does't appear to be valid.", E_USER_ERROR);
			die();
		}
		
		$klass = new $controller ($this->map);
		
		if(!method_exists($klass, $this->map['action'])) {
			trigger_error("Route Error: The method `{$this->map['action']}` does't appear to be valid.", E_USER_ERROR);
			die();
		}
		
		call_user_func_array(array($klass, $this->map['action']), array());
		
		if($klass->redirection !== true) new ActionView($klass, $this->map);
		
	}
开发者ID:469306621,项目名称:Languages,代码行数:20,代码来源:class.dispatcher.php

示例7: getRequestedOp

 /**
  * Retrieve the requested operation from the request
  *
  * NB: This can be an operation that not actually
  * exists in the requested component.
  *
  * @param $request PKPRequest
  * @return string the requested operation or an empty string
  *  if none can be found.
  */
 function getRequestedOp(&$request)
 {
     if (is_null($this->_op)) {
         $this->_op = '';
         // Retrieve the service endpoint parts from the request.
         if (is_null($rpcServiceEndpointParts = $this->_getValidatedServiceEndpointParts($request))) {
             // Endpoint parts cannot be found in the request
             return '';
         }
         // Pop off the operation part
         $this->_op = String::camelize(array_pop($rpcServiceEndpointParts), CAMEL_CASE_HEAD_DOWN);
     }
     return $this->_op;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:24,代码来源:PKPComponentRouter.inc.php

示例8: _parseVars

 /**
  * Parse table properties to build class methods
  * 
  * @param string $field     The field name from the current table
  * @return array            An array of values to build the method
  */
 private function _parseVars($field)
 {
     $field['getMethodName'] = 'get' . String::camelize($field['Field']);
     $field['setMethodName'] = 'set' . String::camelize($field['Field']);
     if ($field['Key'] != '') {
         $field['LoadByMethodName'] = 'loadBy' . String::camelize($field['Field']);
         $field['LoadMethod'] = 'fetchAllObject';
         if ($field['Key'] == 'UNI' || $field['Key'] == 'PRI' && count($this->_primaryKeys) == 1) {
             $field['LoadMethod'] = 'fetchObject';
         }
     }
     return $field;
 }
开发者ID:salomalo,项目名称:php-oxygen,代码行数:19,代码来源:model.class.php

示例9: escape

	function escape($value, $name) {
		$schema = $this->schema;
		$driver = $GLOBALS["CFG_DB"]->CON[$schema]->DRIVER;
		$value = Bean::invoke(String::camelize('_'.$driver.'_driver'), "escape", array($value, $name, $this->meta));
		return $value;
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:6,代码来源:Query.php

示例10: getId

 /**
  * Returns a canonical form of the property
  * name ready to be used as a property id in an
  * external context (e.g. Forms or Templates).
  * @return string
  */
 function getId()
 {
     // Replace special characters in XPath-like names
     // as 'person-group[@person-group-type="author"]'.
     $from = array('[', ']', '@', '"', '=');
     $to = array('-', '', '', '', '-');
     $propertyId = trim(str_replace($from, $to, $this->getName()), '-');
     $propertyId = String::camelize($propertyId);
     return $propertyId;
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:16,代码来源:MetadataProperty.inc.php

示例11: query

	function query($query, $schema = "DEFAULT") {
		$q = "";
		if ($query instanceof Query) {
			$q = $query->sql();
		} else {
			$q = $query;
		}
		$link = MysqlDriver::connect($schema);
		$result = mysql_query($q, $link);
		$rows = array();
		if ($result) {
			if (is_bool($result)) {
				return $result;
			}
			
			$fieldNames = array();
			$camelizeNames = array();
			$fieldTypes = array();
			$fieldCount = mysql_num_fields($result);
			for ($i = 0; $i < $fieldCount; $i++) {
				$fieldNames[$i] = mysql_field_name($result, $i);
				$camelizeNames[$i] = String::camelize($fieldNames[$i]);
				$fieldTypes[$i] = mysql_field_type($result, $i);  
			}
			while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
				$r = array();
				for ($i = 0; $i < $fieldCount; $i++) {
					if ($fieldTypes[$i] == "datetime") {
						$r[$camelizeNames[$i]] = &new Date($row[$fieldNames[$i]]);
					} else {
						$r[$camelizeNames[$i]] = &$row[$fieldNames[$i]];
					}
				}
				$r["__ID__"] = $row["id"];
				$rows[] = &$r;
			}
			mysql_free_result($result);
			return $rows;
		} else {
			return false;
		}

	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:43,代码来源:MysqlDriver.php

示例12: listen

	function listen() {
		$this->pre();
		$methodName = String::camelize("do_".$this->method);
		Bean::invoke($this, $methodName);
		$this->post();
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:6,代码来源:BaseAction.php

示例13: testCamelize

 public function testCamelize()
 {
     $this->assertEquals('CamalCaseString', String::camelize('camal-case-string'));
 }
开发者ID:payneteasy,项目名称:php-library-payneteasy-api,代码行数:4,代码来源:StringTest.php

示例14: set_controller_class

 function set_controller_class()
 {
     $name = $this->controller_name;
     $namespace = '\\Leeflets\\Controller\\';
     if (!$name && !$this->action) {
         $this->controller_name = 'home';
         $this->controller_class = $namespace . 'Home';
         $this->action = 'index';
         return;
     }
     $name = preg_replace('@[/\\-\\.]@', '_', $name);
     $class = $namespace . String::camelize($name);
     if (!class_exists($class)) {
         $path = File::get_class_file_path($this->config, ltrim($class, '\\'));
         if (!file_exists($path) || !method_exists($class, $this->action)) {
             $this->controller_name = 'error';
             $this->controller_class = $namespace . 'Error';
             $this->action = 'e404';
             return;
         }
     }
     $this->controller_class = $class;
 }
开发者ID:pcbrsites,项目名称:leeflets,代码行数:23,代码来源:router.php

示例15: setObjProperties

 /**
  * Set an object properties, the object must extends Document
  * 
  * @param Document $object      The object to set properties
  * @return Document             The object with setted properties
  */
 public function setObjProperties(Document $object)
 {
     foreach ($this->getValues() as $k => $v) {
         $method = 'set' . ucfirst(String::camelize($k));
         $object->{$method}($v);
     }
     return $object;
 }
开发者ID:salomalo,项目名称:php-oxygen,代码行数:14,代码来源:form.class.php


注:本文中的String::camelize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。