本文整理匯總了PHP中eHelper::dasherize方法的典型用法代碼示例。如果您正苦於以下問題:PHP eHelper::dasherize方法的具體用法?PHP eHelper::dasherize怎麽用?PHP eHelper::dasherize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eHelper
的用法示例。
在下文中一共展示了eHelper::dasherize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setAction
/**
* Set current action name
* Example: action_name OR 'action name' OR Action_Name OR 'Action Name' -> converted to ation-name
* Always sanitized
* @param string $action
* @return eRequest
*/
public function setAction($action)
{
$this->_action = strtolower(eHelper::dasherize($this->sanitize($action)));
return $this;
}
示例2: processUploadUrl
function processUploadUrl($import = false, $cat = '_common')
{
$fl = e107::getFile();
$mes = e107::getMessage();
if (vartrue($_POST['upload_remote_url'])) {
$fileName = basename($_POST['upload_url']);
if (strpos($fileName, '?') !== false) {
list($fileName, $bla) = explode("?", $fileName);
}
// remove script extensions.
if (substr($fileName, -4) == ".php" || substr($fileName, -4) == ".htm" || substr($fileName, -5) == ".html" || substr($fileName, -4) == ".asp") {
$fileName = empty($_POST['upload_caption']) ? str_replace(array(".php", ".html", ".asp", ".htm"), '', $fileName) . "_" . time() : eHelper::dasherize(strtolower($_POST['upload_caption']));
}
if (!$fl->getRemoteFile($_POST['upload_url'], $fileName, 'import')) {
$mes->addError("There was a problem grabbing the file");
} elseif ($import == true) {
$data = array('media_caption' => e107::getParser()->filter($_POST['upload_caption'], 'str'));
$result = e107::getMedia()->importFile($fileName, $cat, null, $data);
}
}
}