当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Auth::getinstance方法代码示例

本文整理汇总了PHP中Zend_Auth::getinstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Auth::getinstance方法的具体用法?PHP Zend_Auth::getinstance怎么用?PHP Zend_Auth::getinstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Auth的用法示例。


在下文中一共展示了Zend_Auth::getinstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: logoutAction

 public function logoutAction()
 {
     $auth = Zend_Auth::getinstance();
     $auth->getIdentity();
     if ($auth->hasIdentity() == true) {
         $this->view->code = $auth->getIdentity();
     } else {
         $this->view->code = 'NO';
     }
     $this->forward('login', 'index');
 }
开发者ID:Zziwei,项目名称:Microknow,代码行数:11,代码来源:LoginController.php

示例2: tagAction

 public function tagAction()
 {
     //封装header
     $tuser = new user();
     $auth = Zend_Auth::getinstance();
     #获取auth用户实例
     $auth->getIdentity();
     #取得当前用户信息
     $email = $auth->getIdentity();
     $tuser = new user();
     $user = $tuser->getAllbyEmail($email);
     $header = array("UID" => $user[0]["UID"], "image" => $user[0]["image"]);
     //封装tag
     $ttag = new tag();
     $tans = new answer();
     $task = new ask();
     $tquestion = new question();
     $tfollowq = new followQ();
     $tags = $ttag->getAllTags();
     $tagnum = count($tags);
     $this->view->tags = $tags;
     //print_r($tags);
     for ($i = 0; $i < count($tags); $i++) {
         //第i个tag
         $QIDs = $ttag->getQIDsbyTag($tags[$i]);
         $questionnum = count($QIDs);
         $tag[$i]["tag"] = $tags[$i];
         $questiontmp[0] = 0;
         $answernum[0] = 0;
         for ($j = 0; $j < $questionnum; $j++) {
             //第j个question
             $question = $tquestion->getAllbyQID($QIDs[$j]);
             $QID = $QIDs[$j];
             $title = $question["qtitle"];
             if (strlen($title) > 75) {
                 $title = substr($title, 0, 72);
                 $title = $title . "...";
             }
             $follownum = $tfollowq->getFollownumbyQID($QID);
             $answernum[$j] = $tans->getAnswernumbyQID($QID);
             $questiontmp[$j] = array("QID" => $QID, "title" => $title, "follownum" => $follownum, "answernum" => $answernum[$j]);
         }
         array_multisort($answernum, SORT_DESC, $questiontmp);
         for ($j = 0; $j < min(3, count($questiontmp)); $j++) {
             $Qresult[$i][$j] = $questiontmp[$j];
         }
     }
     $this->view->tag = $tags;
     $this->view->Qresult = $Qresult;
     $this->view->header = $header;
     $this->render('tag');
 }
开发者ID:Zziwei,项目名称:Microknow,代码行数:52,代码来源:IndexController.php

示例3: tagAction

 public function tagAction()
 {
     //封装header
     $auth = Zend_Auth::getinstance();
     #获取当前用户实例
     $UID = $auth->getIdentity();
     #取得当前用户信息
     if ($auth->hasIdentity() == false) {
         $this->render('index');
     }
     $tuser = new user();
     $user = $tuser->getAllbyUID($UID);
     $header = array("UID" => $user["UID"], "image" => $user["image"]);
     //封装tag
     $ttag = new tag();
     $tans = new answer();
     $task = new ask();
     $tquestion = new question();
     $tfollowq = new followQ();
     $tagnum = $ttag->gerRequest()->getParam("tagnum");
     $tags = $ttag->getAllTags();
     for ($i = 0; $i < $tagnum; $i++) {
         //第i个tag
         $QIDs = $ttag->getQIDsbyTags($tags[$i]);
         for ($j = 0; $j < tagnum; $j++) {
             //第j个question
             $mUID = $task->getUIDbyQID($QIDs[$j]);
             $person = $tuser->getAllbyUID($mUID);
             $image1[$j] = $person['image'];
             $question = $tquestion->getAllbyQID($QIDs[$j]);
             $QID1[$j] = $QIDs[$i];
             $title1[$j] = $question["title"];
             $abstract1[$j] = $question["Qabstract"];
             $follownum[$j] = $tfollowq->getFollownumbyQID($QID1[$j]);
             $answernum[$j] = $tans->getAnswernumbyQID($QID1[$j]);
             $tag1[$j] = $ttag->getTagbyQID($QID1[$j]);
             $time1[$j] = $task->getAskTimebyQID($QIDs[$j]);
             $tag[$i][$j] = array("image" => $image1[$j], "QID" => $QIDs[$j], "title" => $title1[$j], "abstract" => $abstract1[$j], "follownum" => $follownum[$j], "answernum" => $answernum[$j], "tag" => $tag1[$j], "time" => $time1[$j]);
         }
     }
     //传递变量,render
     $this->view->tag = $tag;
     $this->view->header = $header;
     $this->render('tag');
 }
开发者ID:Zziwei,项目名称:Microknow,代码行数:45,代码来源:IndexController1.php


注:本文中的Zend_Auth::getinstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。