本文整理汇总了PHP中CApp::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CApp::getLink方法的具体用法?PHP CApp::getLink怎么用?PHP CApp::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApp
的用法示例。
在下文中一共展示了CApp::getLink方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAction
public function deleteAction($id)
{
if ($_SESSION["userRole"] == CApp::settings("USER_ROLES")->ADMIN && $_GET["view"] == "delete" && !empty($_GET["id"])) {
$model = new UserModel();
$model->deleteById($id);
CApp::redirect(CApp::getLink(array("controller" => "user", "view" => "index")));
} else {
CApp::redirect("/");
}
}
示例2: cacheClearAction
public function cacheClearAction()
{
$dirname = $_SERVER["DOCUMENT_ROOT"] . "/cache/";
$dir = opendir($dirname);
while (($file = readdir($dir)) !== false) {
if (is_file($dirname . "/" . $file)) {
unlink($dirname . "/" . $file);
}
}
$path = CApp::getLink(array("controller" => "site", "view" => "settings"));
CApp::redirect($path);
}
示例3: foreach
echo CApp::getTranslate("phone");
?>
</td>
<td><?php
echo CApp::getTranslate("email");
?>
</td>
<td><?php
echo CApp::getTranslate("delete");
?>
</td>
</tr>
<?php
foreach ($arrResult as $arItem) {
$linkView = CApp::getLink(array("controller" => "user", "view" => "view", "id" => $arItem["id"]));
$linkDelete = CApp::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;
示例4:
<tr>
<td><?php
echo CApp::getTranslate('phone');
?>
</td>
<td><input name="registerForm[phone]" type="text"/></td>
</tr>
<tr>
<td><?php
echo CApp::getTranslate('email');
?>
</td>
<td><input name="registerForm[email]" type="text"/></td>
</tr>
<tr><td></td>
<td><input type="submit" value="<?php
echo CApp::getTranslate('register');
?>
" /></td>
</tr>
</form>
<tr>
<td colspan="2"><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("enter");
?>
</a></td>
</tr>
</table>
示例5:
<li><a href="<?php
echo CApp::getLink(array("controller" => "user", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("allUsers");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "translate", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("translate");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "settings"));
?>
"><?php
echo CApp::getTranslate("settings");
?>
</a></li>
</ul>
</div>
<div class="column2">
<form method="post" action="">
<table class="changeUser">
<tr>
<td><?php
echo CApp::getTranslate("login");
?>
示例6:
<div class="column1">
<ul class="menu">
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("createUser");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "about"));
?>
"><?php
echo CApp::getTranslate("allUsers");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "register"));
?>
"><?php
echo CApp::getTranslate("translate");
?>
</a></li>
</ul>
</div>
<div class="column2">
<p><?php
echo __FILE__;
?>
</p>
</div>
示例7:
echo $key;
?>
</td>
<td><input size="50" type="text" name="SETTINGS[<?php
echo $key;
?>
]" value="<?php
echo $value;
?>
" /></td>
</tr><?php
}
?>
<tr>
<td colspan="2"><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "cacheClear"));
?>
"><?php
echo CApp::getTranslate("clearCache");
?>
</a></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="save" value="<?php
echo CApp::getTranslate("save");
?>
"></td>
</tr>
</form>
</table></div>