當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CApp::getLink方法代碼示例

本文整理匯總了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("/");
     }
 }
開發者ID:ennjamusic,項目名稱:study,代碼行數:10,代碼來源:UserController.php

示例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);
 }
開發者ID:ennjamusic,項目名稱:study,代碼行數:12,代碼來源:SiteController.php

示例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;
開發者ID:ennjamusic,項目名稱:study,代碼行數:31,代碼來源:viewList.php

示例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>
開發者ID:ennjamusic,項目名稱:study,代碼行數:31,代碼來源:register.php

示例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");
?>
開發者ID:ennjamusic,項目名稱:study,代碼行數:31,代碼來源:view.php

示例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>
開發者ID:ennjamusic,項目名稱:study,代碼行數:31,代碼來源:index.php

示例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>
開發者ID:ennjamusic,項目名稱:study,代碼行數:31,代碼來源:settings.php


注:本文中的CApp::getLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。