本文整理汇总了PHP中UrlUtil::url方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlUtil::url方法的具体用法?PHP UrlUtil::url怎么用?PHP UrlUtil::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UrlUtil
的用法示例。
在下文中一共展示了UrlUtil::url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: end
public function end()
{
/*$this->attributes['listeners']['afterrender']=$this->afExtjs->asMethod(array(
"parameters"=>"value, metadata, record",
"source"=>"var tb = this.getTopToolbar();
if(!tb) return;
var box = this.getBox();
tb.setWidth(box.width); "
));
*/
$this->attributes['canMask'] = $this->afExtjs->asMethod(array("parameters" => "", "source" => "return !Ext.isIE&&!" . $this->privateName . ".disableLoadMask&&!Ext.get('loading');"));
if (!$this->attributes['tree']) {
$this->attributes['view'] = $this->afExtjs->GroupingColorView(array('forceFit' => $this->attributes['forceFit'], 'groupTextTpl' => ' {text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'));
if (isset($this->attributes['clearGrouping']) && $this->attributes['clearGrouping']) {
@($this->attributes['listeners']['render']["source"] .= "this.store.clearGrouping();");
}
} else {
$this->afExtjs->setAddons(array('css' => array($this->afExtjs->getPluginsDir() . 'treegrid/css/TreeGrid.css'), 'js' => array($this->afExtjs->getPluginsDir() . 'treegrid/TreeGrid.js', $this->afExtjs->getPluginsDir() . 'treegrid/Ext.ux.SynchronousTreeExpand.js')));
$this->attributes['viewConfig'] = $this->afExtjs->asAnonymousClass(array('forceFit' => $this->attributes['forceFit']));
}
if (isset($this->proxy['url']) && count($this->columns) > 0) {
$this->proxy['url'] = sfContext::getInstance()->getRequest()->getRelativeUrlRoot() . $this->proxy['url'];
$filtersPrivateName = 'filters_' . Util::makeRandomKey();
$storePrivateName = 'store_' . Util::makeRandomKey();
$readerPrivateName = 'reader_' . Util::makeRandomKey();
if ($this->attributes['pager']) {
$pagingToolbarPrivateName = 'pt_' . Util::makeRandomKey();
}
$wasSort = false;
$firstSortableCol = null;
$summaryPlugin = false;
foreach ($this->columns as $column) {
$temp_column = null;
$temp_field = null;
$temp_name = 'Header ' . Util::makeRandomKey();
$temp_column['dataIndex'] = isset($column['name']) ? $column['name'] : Util::stripText($temp_name);
$temp_field['name'] = isset($column['name']) ? $column['name'] : Util::stripText($temp_name);
//$temp_field['type']=isset($column['type'])?$column['type']:'auto';
$temp_field['sortType'] = isset($column['sortType']) ? $column['sortType'] : 'asText';
$temp_column['sortType'] = isset($column['sortType']) ? $column['sortType'] : 'asText';
//Grid summary plugin
$temp_column['summaryType'] = isset($column['summaryType']) ? $column['summaryType'] : null;
if (!$summaryPlugin && $temp_column['summaryType'] != null) {
$this->attributes['plugins'][] = "new Ext.ux.grid.GridSummary";
$summaryPlugin = true;
}
$temp_column['header'] = isset($column['label']) ? $column['label'] : $temp_name;
$temp_column['sortable'] = isset($column['sortable']) ? $column['sortable'] : true;
if (isset($column['width']) && $column['width'] != 'auto') {
$temp_column['width'] = $column['width'];
}
$temp_column['hidden'] = isset($column['hidden']) ? $column['hidden'] : false;
$temp_column['hideable'] = isset($column['hideable']) ? $column['hideable'] : true;
$temp_column = $this->formatNumberColumn($temp_column);
/**
* Edit link at defined column
* Please comment this block if the edit should be under the Actions column.
* This section looks the edit="true" in the xml columns. If found, and if
* there is a row actions matching the name or label with edit, this will
* be transformed to the edit="true" column
*/
if (isset($column['edit']) && $column['edit'] || isset($column['action'])) {
//print_r($this->actionsObject);
if ($this->actionsObject) {
$actions = $this->actionsObject->getActions();
//print_r($actions);
if (is_array($actions)) {
foreach ($actions as $key => $action) {
if (isset($column['action']) && preg_match("/list[0-9]+_" . preg_replace("/^\\//", "", $column['action']) . "\$/", $action['name']) || isset($column['edit']) && $column['edit'] === "true" && (preg_match("/_edit\$/", $action['name']) || preg_match("/edit\$/i", $action['label']) || preg_match("/_modify\$/", $action['name']) || preg_match("/modify\$/i", $action['label']) || preg_match("/_update\$/", $action['name']) || preg_match("/update\$/i", $action['label']))) {
$urlIndex = $action['urlIndex'];
$credential = ComponentCredential::urlHasCredential($action['url']);
$actionUrl = UrlUtil::url($action['url']);
if (isset($action['load']) && $action['load'] == "page") {
$actionUrl = $action['url'];
}
$temp_column['renderer'] = $this->afExtjs->asMethod(array("parameters" => "value, metadata, record", "source" => "if(!" . intval($credential) . ") return value;var action = record.get('" . $urlIndex . "'); if(!action) return value; var m = action.toString().match(/.*?\\?(.*)/);return '<a href=\"" . $actionUrl . "?'+m[1]+'\" qtip=\"" . (isset($action['tooltip']) ? $action['tooltip'] : '') . "\">'+ value + '</a>';"));
$this->actionsObject = $this->actionsObject->changeProperty($action['name'], 'hidden', true);
if (isset(afExtjs::getInstance()->private[$this->actionsObject->privateName])) {
unset(afExtjs::getInstance()->private[$this->actionsObject->privateName]);
}
$this->actionsObject->end();
$this->movedRowActions++;
}
}
}
}
}
/*
* check for context menu
*/
$style = '';
$arrowSpan = '';
if (isset($column['contextMenu']) && $column['contextMenu']) {
$style = "";
$arrowSpan = '<span class="interactive-arrow"><a class="interactive-arrow-a" href="#"> </a></span>';
$contextMenu = context_menu($column['contextMenu'])->privateName;
$this->contextMenu[$temp_field['name']] = $contextMenu;
$temp_column['renderer'] = $this->afExtjs->asMethod(array("parameters" => "value, metadata, record", "source" => "return '<span {$style}>{$arrowSpan}' + value + '</span>';"));
}
/*else{
//.........这里部分代码省略.........