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