本文整理汇总了PHP中Alias::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::get方法的具体用法?PHP Alias::get怎么用?PHP Alias::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
$oquery = urldecode(substr($_SERVER['REQUEST_URI'], 1));
$p = explode('?', $oquery, 2);
$query = $p[0];
$newurl = Alias::get($query);
if ($newurl) {
if (!empty($p[1])) {
$newurl .= '?' . $p[1];
}
if ($newurl === $oquery) {
return;
}
header('Location: /' . $newurl, true, 301);
exit;
}
}
示例2: __construct
/**
* @param Alias $alias
* @param string $baseUrl
*/
public function __construct(Alias $alias, $baseUrl)
{
$this->alias = $alias;
$this->assetsPath = $alias->get('@web') . $this->assetsDir;
$this->assetsUrl = rtrim($baseUrl, '/') . $this->assetsDir;
}
示例3: db_query
if ($_REQUEST['g'] == 'gift' && !empty($_POST['productID'])) {
$productID = $_POST['productID'];
$name_from = $_POST['nameFrom'];
$email_from = $_POST['emailFrom'];
$name_to = $_POST['nameTo'];
$email_to = $_POST['emailTo'];
$message = $_POST['message'];
$sql = '
SELECT productID, name
FROM ' . PRODUCTS_TABLE . '
WHERE productID = ' . (int) $productID;
$q = db_query($sql);
$offer = array();
while ($row = db_fetch_row($q)) {
$alias = Alias::get(NULL, Alias::MODULE_PRODUCT, $row['productID']);
$offer['name'] = $row['name'];
$offer['alias'] = $alias['uri'];
}
if (CONF_MOD_REWRITE) {
if ($offer['alias']) {
$offer_url = $offer['alias'] . '/';
} else {
$offer_url = 'product_' . $productID . '.html';
}
} else {
$offer_url = 'index.php?productID=' . $productID;
}
$assign = array('offer_id' => $productID, 'offer_name' => $offer['name'], 'offer_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/' . $offer_url, 'name_from' => $name_from, 'name_to' => $name_to, 'email_from' => $email_from, 'message' => $message);
$subject = $name_from . ' хочет получить от Вас подарок';
if (dizMail($email_to, $subject, 'gift_mail', $assign)) {