本文整理汇总了PHP中UrlManager::add方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlManager::add方法的具体用法?PHP UrlManager::add怎么用?PHP UrlManager::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UrlManager
的用法示例。
在下文中一共展示了UrlManager::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_lang
}
// else fail silently
}
// else fail silently
}
$url_to_go = 'access_urls.php';
$message = get_lang('URLEdited');
} else {
$num = UrlManager::url_exist($url);
if ($num == 0) {
// checking url
if (substr($url, strlen($url) - 1, strlen($url)) == '/') {
UrlManager::add($url, $description, $active);
} else {
//create
UrlManager::add($url . '/', $description, $active);
}
$message = get_lang('URLAdded');
$url_to_go = 'access_urls.php';
} else {
$url_to_go = 'access_url_edit.php';
$message = get_lang('URLAlreadyAdded');
}
// URL Images
$url .= substr($url, strlen($url) - 1, strlen($url)) == '/' ? '' : '/';
$url_id = UrlManager::get_url_id($url);
$url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
$image_fields = array("url_image_1", "url_image_2", "url_image_3");
foreach ($image_fields as $image_field) {
if ($_FILES[$image_field]['error'] == 0) {
// Hardcoded: only PNG files allowed
示例2: get_lang
}
// else fail silently
}
*/
$url_to_go = 'index.php';
$message = get_lang('URLEdited');
} else {
error_log(__LINE__);
$num = UrlManager::url_exist($url);
if ($num == 0) {
//checking url
if (substr($url, -1) == '/') {
$url .= '/';
}
error_log(__LINE__);
UrlManager::add($url, $description, $active, $url_type, $url_array);
$message = get_lang('URLAdded');
$url_to_go = 'index.php';
} else {
$url_to_go = 'index.php';
$message = get_lang('URLAlreadyAdded');
}
// URL Images
$url .= substr($url, -1) == '/' ? '' : '/';
$url_id = UrlManager::get_url_id($url);
/*
$url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
$image_fields = array("url_image_1", "url_image_2", "url_image_3");
foreach ($image_fields as $image_field) {
if ($_FILES[$image_field]['error'] == 0) {
// Hardcoded: only PNG files allowed