本文整理匯總了PHP中StringHelper::camelToFlat方法的典型用法代碼示例。如果您正苦於以下問題:PHP StringHelper::camelToFlat方法的具體用法?PHP StringHelper::camelToFlat怎麽用?PHP StringHelper::camelToFlat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StringHelper
的用法示例。
在下文中一共展示了StringHelper::camelToFlat方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($table = '')
{
parent::__construct();
$this->_error = array();
$this->_fields = array();
if (empty($table)) {
$this->_table = StringHelper::camelToFlat(__CLASS__);
} else {
$this->_table = $table;
}
}
示例2: addReferrer
public function addReferrer($url = '', $historic = false)
{
if (!$url) {
if (!($url = $this->autoReferrer($historic))) {
return false;
}
}
$url = StringHelper::camelToFlat($url);
$arr = $_SESSION['appReferrers'];
// copy
// search for previous entry with same url
while ($tmp = @array_pop($arr)) {
if ($tmp == $url) {
// been to this page, need to clean referrers
$_SESSION['appReferrers'] = $arr;
break;
}
}
// add url to referrer
$_SESSION['appReferrers'][] = $url;
return true;
}
示例3: autoLoad
/**
* autoload class
* @parameter would require the type of class to be said in there
*/
private static function autoLoad($name)
{
$str = StringHelper::camelToFlat($name);
$type = 'class';
$sep = strrpos($str, '_');
if ($sep) {
$class = substr($str, 0, $sep);
$type = substr($str, $sep + 1);
switch ($type) {
case 'helper':
case 'class':
case 'controller':
case 'model':
case 'view':
// valid type
break;
default:
// invalid type, must be a core class
$type = 'class';
break;
}
}
return self::load($name, $type);
}