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


PHP Website::find方法代碼示例

本文整理匯總了PHP中Website::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Website::find方法的具體用法?PHP Website::find怎麽用?PHP Website::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Website的用法示例。


在下文中一共展示了Website::find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: reAction

 public function reAction($token)
 {
     $item = Website::find(array('conditions' => 'token = ?1', 'bind' => array(1 => $token), 'cache' => array('key' => $token, 'lifetime' => 7200 * 24)))->getFirst();
     if ($item) {
         $item->vote += rand(1, 10);
         $item->save();
         $this->response->redirect($item->href, true);
     } else {
         $this->response->redirect('/', true);
     }
 }
開發者ID:phantom9999,項目名稱:home-page,代碼行數:11,代碼來源:IndexController.php

示例2: home

 /**
  * [home 網站設置]
  * @return [type] [description]
  */
 public function home()
 {
     if (IS_POST) {
         $data = ['web_title' => I('post.web_title'), 'web_keyword' => I('post.web_keyword'), 'web_desription' => I('post.web_desription'), 'web_footer' => I('post.web_footer')];
         Website::where(['id' => 1])->update($data);
         View::success('更新成功');
         die;
     }
     $webData = Website::find(1)->toArray();
     //print_r($webData);
     $this->smarty->assign('webData', $webData);
     $this->smarty->assign('title', '網站設置_ISisWeb中文網後台管理_ISirPHPFramework');
     $this->smarty->display('Admin/System/home.html');
     die;
     // $this->view = View::make('/Admin/System/home')
     // 			   ->with('webData',$webData)
     // 			   ->with('title','網站設置_ISirWeb中文網');
 }
開發者ID:joymi,項目名稱:ISirPHPFramework,代碼行數:22,代碼來源:SystemController.php

示例3: artice

 /**
  * [artice 文章內容]
  * @return [type] [description]
  */
 public function artice($slug)
 {
     $webSite = Website::find(1)->toArray();
     $arcData = Article::with('belongsToCategory')->find($slug)->toArray();
     //print_r($arcData);
     $hotArcData = Article::with('belongsToCategory')->where(['is_del' => 0])->get()->toArray();
     $linkData = Link::where(['is_look' => 1])->get()->toArray();
     //print_r($linkData);
     $cateData = Category::where(['is_del' => 0])->get()->toArray();
     //print_r($cateData);
     $item = [];
     foreach ($cateData as $k => $v) {
         if (!isset($item[$v['id']])) {
             $item[$v['id']] = $v;
         } else {
             $item[$v['id']] = $v;
         }
     }
     //上一篇
     $pre = Article::get_pre($slug);
     //print_r($pre);
     //下一篇
     $next = Article::get_next($slug);
     //print_r($next);
     //相關文章
     $this->smarty->assign('pre', $pre);
     $this->smarty->assign('next', $next);
     $this->smarty->assign('webSite', $webSite);
     $this->smarty->assign('hotArcData', $hotArcData);
     $this->smarty->assign('cateData', $item);
     $this->smarty->assign('slug', $slug);
     $this->smarty->assign('linkData', $linkData);
     $this->smarty->assign('article', $arcData);
     $this->smarty->display('Index/article.html');
 }
開發者ID:joymi,項目名稱:ISirPHPFramework,代碼行數:39,代碼來源:HomeController.php


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