本文整理汇总了PHP中CMain::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CMain::getLink方法的具体用法?PHP CMain::getLink怎么用?PHP CMain::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMain
的用法示例。
在下文中一共展示了CMain::getLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo $langArray["phone"];
?>
</td>
<td><?php
echo $langArray["email"];
?>
</td>
<td><?php
echo $langArray["delete"];
?>
</td>
</tr>
<?php
foreach ($arrResult as $arItem) {
$linkView = CMain::getLink(array("controller" => "user", "view" => "view", "id" => $arItem["id"]));
$linkDelete = CMain::getLink(array("controller" => "user", "view" => "delete", "id" => $arItem["id"]));
?>
<tr>
<td><?php
echo $arItem["id"];
?>
</td>
<td><a href="<?php
echo $linkView;
?>
"><?php
echo $arItem["login"];
?>
</a></td>
<td><a href="<?php
echo $linkView;
示例2:
<div class="column1">
<ul class="menu">
<li><a href="<?php
echo CMain::getLink(array("controller" => "user", "view" => "create"));
?>
"><?php
echo $langArray["createUser"];
?>
</a></li>
<li><a href="<?php
echo CMain::getLink(array("controller" => "user", "view" => "index"));
?>
"><?php
echo $langArray["allUsers"];
?>
</a></li>
</ul>
</div>
<div class="column2">
<form method="post" action="">
<table class="changeUser">
<tr>
<td><?php
echo $langArray["login"];
?>
</td>
<td><input type="text" name="user[login]" value="<?php
echo $arrResult["login"];
?>
"></td>
示例3: foreach
<table class="userList" border>
<tr class="table-head">
<td><a href="?sort=id¶m=asc">ID asc</a>/<br /><a href="?sort=id¶m=desc">ID desc</a></td>
<td><a href="?sort=login¶m=asc">LOGIN asc</a>/<br /><a href="?sort=login¶m=desc">LOGIN desc</a></td>
<td><a href="?sort=role¶m=asc">ROLE asc</a>/<br /><a href="?sort=role¶m=desc">ROLE desc</a></td>
<td><a href="?sort=firstName¶m=asc">NAME asc</a>/<br /><a href="?sort=firstName¶m=desc">NAME desc</a></td>
<td><a href="?sort=lastName¶m=asc">SURNAME asc</a>/<br /><a href="?sort=lastName¶m=desc">SURNAME desc</a></td>
<td><a href="?sort=birthday¶m=asc">DATE asc</a>/<br /><a href="?sort=birthday¶m=desc">DATE desc</a></td>
<td>PHONE</td>
<td>EMAIL</td>
<td>DELETE</td>
</tr>
<?php
foreach ($arrResult as $arItem) {
$link = CMain::getLink(array("controller" => "user", "view" => "view", "id" => $arItem["id"]));
?>
<tr>
<td><?php
echo $arItem["id"];
?>
</td>
<td><a href="<?php
echo $link;
?>
"><?php
echo $arItem["login"];
?>
</a></td>
<td><a href="<?php
echo $link;