本文整理汇总了PHP中StringHelper::flatToCamel方法的典型用法代码示例。如果您正苦于以下问题:PHP StringHelper::flatToCamel方法的具体用法?PHP StringHelper::flatToCamel怎么用?PHP StringHelper::flatToCamel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHelper
的用法示例。
在下文中一共展示了StringHelper::flatToCamel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPlugin
protected function addPlugin($key, $obj = null)
{
if (is_null($obj)) {
$class = StringHelper::flatToCamel($key, true);
$this->_plugins[$key] = new $class();
} else {
$this->_plugins[$key] = $obj;
}
}
示例2: __construct
/**
* constructor
* @param mixed $login is user login required
*/
public function __construct($login = false, $iphone = false)
{
parent::__construct();
// get front controller instance
$this->fc = FrontController::getInstance();
// instantiate page
$this->page = new PageModel();
// detect iphone
if (preg_match('/' . APP_IPHONE_AGENT . '/', $_SERVER['HTTP_USER_AGENT']) && !$iphone) {
NaviHelper::redirect($this->fc->getUrl('iphone'));
}
// check login ?
if ($login && APP_SETUP_USER_MODEL) {
if (!$this->fc->user->isLoggedIn()) {
if (is_string($login)) {
if ($this->fc->controller != StringHelper::flatToCamel($login, true) || $this->fc->action != 'login') {
NaviHelper::redirect($this->fc->getUrl($login, 'login'));
}
} else {
NaviHelper::redirect($this->fc->getUrl('login'));
}
}
}
}
示例3: isObjectProperty
/**
* checks if property is a class
* @param string $key property name
* @param string $class model's class name (returned)
* @param string $nkey key name for SQL statements (returned)
*/
public function isObjectProperty($key, &$class, &$nkey)
{
$class = $nkey = '';
if (empty($this->_properties[$key])) {
return false;
}
$type = $this->_properties[$key];
if (preg_match('/^OBJ(,([a-z0-9_]*))?$/', $type, $match)) {
$nkey = count($match) > 2 ? $match[2] : $key;
$class = StringHelper::flatToCamel(count($match) > 2 ? $nkey : $nkey . '_model', true);
return true;
} else {
return false;
}
}
示例4: parseUrl
/**
* parse request for controller, action and other parameters
*/
public function parseUrl()
{
// clean ugly magic quotes
self::cleanRequest();
$req = $_SERVER['REQUEST_URI'];
// remove subfolder setup if non virtual host
if (strlen(APP_WWW_URI) > 1) {
$req = str_ireplace(APP_WWW_URI, '', $req);
}
// remove trailing slashes
$req = trim($req, '/');
// parse if non empty
if ($req) {
if ($pos = strrpos($req, '.html')) {
$req = substr($req, 0, $pos);
} else {
if ($pos = strrpos($req, '?')) {
$req = substr($req, 0, $pos);
}
}
$arrReq = explode('/', $req);
if (count($arrReq)) {
$this->controller = array_shift($arrReq);
}
if (count($arrReq)) {
$this->action = array_shift($arrReq);
} else {
$this->action = 'main';
}
while (count($arrReq)) {
$key = array_shift($arrReq);
if (count($arrReq)) {
$val = array_shift($arrReq);
$this->request[$key] = urldecode($val);
} else {
$this->request[$key] = '';
}
}
}
// parse query string
if (count($_REQUEST)) {
foreach ($_REQUEST as $key => $val) {
switch ($key) {
case 'c':
$this->controller = $val;
break;
case 'a':
$this->action = $val;
break;
default:
$this->request[$key] = $val;
break;
}
}
}
// get real names
$this->controller = StringHelper::flatToCamel($this->controller, true, '-');
$this->action = StringHelper::flatToCamel($this->action, false, '-');
}