本文整理汇总了PHP中request::uriDef方法的典型用法代码示例。如果您正苦于以下问题:PHP request::uriDef方法的具体用法?PHP request::uriDef怎么用?PHP request::uriDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::uriDef方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
protected function prepare() {
$htVars = http_vars::getInstance();
$this->type = $htVars->post('type', $htVars->get('type'));
$this->config = $htVars->post('config', $htVars->get('config', 'default'));
$this->myCfg = $this->cfg->default;
if ($this->config != 'default' && is_array($this->cfg->get($this->config)))
factory::mergeCfg($this->myCfg, $this->cfg->get($this->config));
$this->dir = $this->myCfg['dir'];
if ($this->myCfg['subdir'])
$this->dir.= DS.$this->myCfg['subdir'];
$this->dir.= DS.$this->type;
$resp = response::getInstance();
/* @var $resp response_http_html */
$resp->setLayout($this->myCfg['layout']);
$resp->setTitle($this->myCfg['title']);
$resp->initIncFiles(false);
foreach($this->myCfg['incFiles'] as $ic)
$resp->add($ic);
$this->uri = request::uriDef(array('module')).'?'.session::getInstance()->getSessIdForce().'='.urlencode(session_id()).'&type='.$this->type.'&config='.$this->config.'&';
}
示例2: renderAdminMenu
protected function renderAdminMenu(array $prm = null)
{
$links = array();
if (security::getInstance()->isLogged()) {
$db = db::getInstance();
$tables = $db->getTables();
foreach ($tables as $t) {
if (!strpos($t, '_') && !strpos($t, db::getCfg('i18n'))) {
$links[$t] = request::uriDef(array('module' => $t, 'action' => '', 'param' => ''));
}
}
}
$this->setViewVar('linksTable', $links);
}
示例3: array
<?php
$cfg = array('table' => REQUIRED, 'query' => null, 'name' => REQUIRED, 'sessionName' => null, 'useSession' => true, 'nameParam' => null, 'nbPerPage' => 50, 'nbPageMax' => false, 'page' => 1, 'sortBy' => null, 'sortDir' => 'asc', 'pageLinkReplace' => '[page]', 'pageLinkTpl' => null, 'pageLinkTpl1' => null, 'iconType' => null, 'addIdentField' => true, 'fields' => null, 'noData' => 'No Data.', 'tplVars' => array('sortIndicatorAsc' => '^', 'sortIndicatorDesc' => 'v'), 'actions' => array(), 'actionsAlt' => array(), 'actionsImg' => array(), 'actionsAllowed' => null, 'actionsAllowedDefault' => null, 'actionsConfirmDelete' => true, 'addCheckAllJs' => true, 'multiple' => array(), 'multipleLabel' => 'Choose an action', 'multipleSubmit' => 'ok', 'multipleAction' => request::uriDef(array('action' => 'multiple'), array('module')), 'cache' => array());
示例4: clearLink
/**
* Get the clear URL link
*
* @return string
*/
public function clearLink()
{
$prmA = array_merge(array_diff_key(request::get('paramA'), $this->cfg->actionPrmClear), $this->cfg->actionPrmForce);
$prmA[$this->cfg->clearPrm] = 1;
return request::uriDef(array('paramA' => $prmA));
}
示例5: to
/**
* Create the data Table out
*
* @param string $type Out type
* @return string
*/
public function to($type)
{
$tpl = factory::get('tpl', array('module' => $this->cfg->module, 'action' => $this->cfg->name, 'default' => 'dataTable', 'cache' => $this->cfg->cache, 'layout' => false));
$data = $this->getData();
if (count($data)) {
if (empty($this->cfg->fields)) {
$headersT = $data->getFields('flatReal');
if ($keyRelated = array_search('related', $headersT)) {
unset($headersT[$keyRelated]);
}
foreach ($this->table->getI18nFields() as $f) {
$headersT[] = db::getCfg('i18n') . $f['name'];
}
} else {
$headersT = $this->cfg->fields;
if ($this->cfg->addIdentField && !in_array($this->table->getIdent(), $headersT)) {
array_unshift($headersT, $this->table->getIdent());
}
}
$headers = array();
$prmReplaceSortBy = '[sortBy]';
$prmReplaceSortDir = '[sortDir]';
$paramUrlA = request::get('paramA');
unset($paramUrlA['page' . $this->cfg->nameParam]);
$paramUrlA['sortBy' . $this->cfg->nameParam] = $prmReplaceSortBy;
$paramUrlA['sortDir' . $this->cfg->nameParam] = $prmReplaceSortDir;
$paramUrlA['page' . $this->cfg->nameParam] = 1;
$tmpSortLink = request::uriDef(array('paramA' => $paramUrlA));
foreach ($headersT as $k => $h) {
$typeField = $this->table->getField($h, 'type');
if ($typeField == 'file' && is_array($tmp = $this->table->getField($h, 'comment')) && array_key_exists(0, $tmp)) {
$typeField = $tmp[0];
}
$headers[$k] = array('label' => $this->table->getLabel($h), 'name' => $h, 'url' => str_replace(array($prmReplaceSortBy, $prmReplaceSortDir), array(db::isI18nName($h) ? $this->table->getI18nTable()->getName() . '_' . db::unI18nName($h) : $h, $this->cfg->sortBy == $h && $this->cfg->sortDir == 'asc' ? 'desc' : 'asc'), $tmpSortLink), 'type' => $typeField);
}
$actions = null;
$actionsAlt = null;
$actionsImg = null;
if (is_array($this->cfg->actions) && !empty($this->cfg->actions)) {
$actions = array();
if (!$this->cfg->addIdentField) {
array_unshift($headersT, $this->table->getIdent());
}
array_walk($headersT, create_function('&$h', '$h = "[".$h."]";'));
$dataK = null;
$i = 0;
foreach ($data as $d) {
$tmp = $this->getActions($d);
$tmpVals = $d->getValues('flatNoRelated');
$vals = array();
foreach ($headersT as $k => $v) {
$v = substr($v, 1, -1);
$vals[$k] = array_key_exists($v, $tmpVals) ? $tmpVals[$v] : null;
}
$curData = $d->getValues('data');
unset($curData['related']);
unset($curData['linked']);
if (is_null($dataK)) {
$dataK = array_keys($curData);
array_walk($dataK, create_function('&$h', '$h = "[".$h."]";'));
}
foreach ($tmp as &$t) {
$t = str_replace($dataK, $curData, $t);
}
$actions[$i] = $tmp;
$i++;
}
if (!empty($actions) && $this->cfg->actionsConfirmDelete) {
response::getInstance()->addJs('actionsConfirmDelete');
}
$actionsKey = array_keys($this->cfg->actions);
$actionsAlt = $this->cfg->actionsAlt;
if (!is_array($actionsAlt) || count($actionsAlt) < count($actionsKey)) {
foreach ($actionsKey as $v) {
if (!array_key_exists($v, $actionsAlt)) {
$actionsAlt[$v] = ucfirst($v);
}
}
}
$actionsImg = $this->cfg->actionsImg;
foreach ($actionsKey as $v) {
if (!array_key_exists($v, $actionsImg)) {
$actionsImg[$v] = utils::getIcon(array('name' => $v, 'attr' => array('title' => $actionsAlt[$v]), 'alt' => $actionsAlt[$v], 'type' => $this->cfg->iconType));
}
}
}
if ($this->cfg->sortBy) {
$paramUrlA['sortBy' . $this->cfg->nameParam] = $this->cfg->sortBy;
$paramUrlA['sortDir' . $this->cfg->nameParam] = $this->cfg->sortDir;
} else {
unset($paramUrlA['sortBy' . $this->cfg->nameParam]);
unset($paramUrlA['sortDir' . $this->cfg->nameParam]);
}
$nbPage = $this->getNbPage();
//.........这里部分代码省略.........
示例6: array
<?php
$cfg = array(
'name'=>null,
'prefixExec'=>'scaffold',
'autoRelated'=>true,
'filter'=>null,
'list'=>null,
'show'=>null,
'edit'=>null,
'addFilterTableJs'=>true,
'filterOpts'=>array(
'formOpts'=>array(
'formPlus'=>' class="filterTable"'
)
),
'formOpts'=>array(),
'allowAdd'=>true,
'iconType'=>null,
'multipleDelete'=>NYROENV == 'admin',
'multipleAction'=>request::uriDef(array('action'=>'multiple'), array('module')),
'multiple'=>array(),
'listPrm'=>array(),
);
示例7: execScaffoldShow
protected function execScaffoldShow($prm = null) {
$id = $prm[0];
$this->row = $this->table->find($id);
$this->hook('show');
$this->form = $this->row->getForm($this->getFields('show'), array('mode'=>'view', 'sectionName'=>tr::__('scaffold_show')), false);
$this->form->action = request::uriDef(array('module'=>$this->table->getName(),'action'=>'edit', 'param'=>$id));
$this->form->method = 'get';
$this->form->setSubmitText(tr::__('scaffold_goEdit'));
$this->form->setSubmitplus('<a href="'.$this->indexPage.'">'.tr::__('scaffold_back').'</a>');
$this->hook('formShow');
$this->setViewVars(array(
'row'=>$this->row,
'form'=>$this->form
));
}