本文整理汇总了PHP中URI::hidden方法的典型用法代码示例。如果您正苦于以下问题:PHP URI::hidden方法的具体用法?PHP URI::hidden怎么用?PHP URI::hidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::hidden方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_form
/**
* display form with filters and search field
*/
public function display_form() {
?>
<form action="<?php
echo BN;
?>
" method="GET" class="filter">
<?
// pass on all other parameters
URI::hidden(['filter'=>null, 'search'=>null, 'page'=>null]);
// filter
if ($this->filters) {
$this->display_select_filter();
}
// search
if ( $this->enable_search ) {
?>
<input type="text" name="search" value="<?php
echo $this->search;
?>
" size="20">
<input type="submit" value="<?php
echo _("search and filter");
?>
">
<?
} else {
?>
<input type="submit" value="<?php
echo _("filter");
?>
">
<?
}
?>
<a href="<?php
echo URI::strip(['filter', 'search']);
?>
"><?php
echo _("reset");
?>
</a>
</form>
<?
}
示例2: display_switch
/**
* display Ngroup drop down menu
*/
public static function display_switch() {
?>
<form method="GET" action="<?
switch (BN) {
// jump to proposals list if the same page doesn't show the equivalent content in other groups
case "proposal.php":
case "proposal_edit.php":
case "draft.php":
case "vote.php":
case "vote_result.php":
echo "proposals.php";
$hidden = false;
break;
default:
echo BN;
// pages with list and edit mode and content depending on the group
case "periods.php":
case "admin_areas.php":
$hidden = array(
'ngroup' => null, // remove ngroup, because the new ngroup comes from the drop down menu
'id' => null // remove id to go back from edit to list mode
);
}
?>">
<select name="ngroup" onchange="this.form.submit()" tabindex="2">
<?
if (Login::$member) {
$sql = "SELECT ngroup.*, member FROM ngroup
LEFT JOIN member_ngroup ON member_ngroup.ngroup = ngroup.id AND member_ngroup.member = ".intval(Login::$member->id);
} else {
$sql = "SELECT * FROM ngroup";
}
$sql .= " ORDER BY name";
$result = DB::query($sql);
$ngroups = array();
while ( $ngroup = DB::fetch_object($result, "Ngroup") ) {
$ngroups[] = $ngroup;
}
$ngroups = Ngroup::parent_sort_active($ngroups);
// own ngroups
if (Login::$member) {
?>
<optgroup label="<?php
echo _("own groups");
?>
">
<?
foreach ($ngroups as $ngroup) {
if (!$ngroup->member) continue;
// save groups list of the logged in member
Login::$ngroups[] = $ngroup->id;
// use the first ngroup as default
if ($_SESSION['ngroup']==0) $_SESSION['ngroup'] = $ngroup->id;
?>
<option value="<?php
echo $ngroup->id;
?>
"<?
if ($ngroup->id==$_SESSION['ngroup']) { ?> selected class="selected"<? }
?>>◆ <?php
echo $ngroup->name;
?>
</option>
<?
}
?>
</optgroup>
<?
}
// other ngroups
?>
<optgroup label="<?php
echo Login::$member ? _("other groups") : _("groups");
?>
">
<?
foreach ($ngroups as $ngroup) {
// save list of active groups
Ngroup::$active_ngroups[] = $ngroup->id;
if (Login::$member and $ngroup->member) continue;
// use the first ngroup as default
if ($_SESSION['ngroup']==0) $_SESSION['ngroup'] = $ngroup->id;
?>
<option value="<?php
echo $ngroup->id;
?>
"<?
if ($ngroup->id==$_SESSION['ngroup']) { ?> selected class="selected"<? }
?>>◇ <?php
echo $ngroup->name;
?>
</option>
<?
}
?>
</optgroup>
</select>
//.........这里部分代码省略.........