本文整理汇总了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);
}