本文整理匯總了PHP中cmsFramework::constructRoute方法的典型用法代碼示例。如果您正苦於以下問題:PHP cmsFramework::constructRoute方法的具體用法?PHP cmsFramework::constructRoute怎麽用?PHP cmsFramework::constructRoute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cmsFramework
的用法示例。
在下文中一共展示了cmsFramework::constructRoute方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initialize
function initialize($params = array())
{
if (count($params) > 0) {
foreach ($params as $key => $val) {
$this->{$key} = $val;
}
}
# Construct new route
if (isset($this->passedArgs) && is_null($this->base_url)) {
$this->base_url = cmsFramework::constructRoute($this->passedArgs, array('page', 'limit', 'lang'));
}
}
示例2: generateFormSelect
function generateFormSelect($orderingList, $selected, $attributes)
{
# Construct new route
$new_route = cmsFramework::constructRoute($this->passedArgs, array('order', 'page'));
$selectList = array();
foreach ($orderingList as $value => $text) {
$selectList[] = array('value' => cmsFramework::route($new_route . '/order' . _PARAM_CHAR . $value), 'text' => $text);
}
$selected = cmsFramework::route($new_route . '/order' . _PARAM_CHAR . $selected);
return $this->Form->select('order', $selectList, $selected, $attributes);
}
示例3: listingsFeed
function listingsFeed($title = '', $attributes = array())
{
$base_url = rtrim(cmsFramework::constructRoute($this->passedArgs), '/') . '/action:xml/';
$title = sprintf(__t("%s listing feeds", true), $title);
if (isset($attributes['return_url'])) {
$base_url = cmsFramework::route($base_url);
return $base_url;
} else {
$attributes = array_merge(array('title' => $title, 'class' => 'jr_feedListings'), $attributes);
return $this->Html->link('', $base_url, $attributes);
}
}
示例4: generateFormSelect
function generateFormSelect($orderingList, $selected, $attributes)
{
# Construct new route
$new_route = cmsFramework::constructRoute($this->passedArgs, array('lang', 'order', 'page'));
if (Sanitize::getInt($this->params, 'page', 1) == 1 && preg_match('/^(index.php\\?option=com_jreviews&Itemid=[0-9]+)(&url=menu\\/)$/i', $new_route, $matches)) {
// Remove menu segment from url if page 1 and it' a menu
$new_route_page_1 = $matches[1];
}
$selectList = array();
foreach ($orderingList as $value => $text) {
$default_order = Sanitize::getString($this->params, 'default_order');
// Default order takes user back to the first page
if ($value == $default_order) {
$selectList[] = array('value' => cmsFramework::route($new_route_page_1), 'text' => $text);
} else {
$selectList[] = array('value' => cmsFramework::route($new_route . '/order' . _PARAM_CHAR . $value), 'text' => $text);
}
}
if ($selected == $default_order) {
$selected = cmsFramework::route($new_route_page_1);
} else {
$selected = cmsFramework::route($new_route . '/order' . _PARAM_CHAR . $selected);
}
return $this->Form->select('order', $selectList, $selected, $attributes);
}