当前位置: 首页>>代码示例>>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;未经允许,请勿转载。