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


PHP Courses::findOneByPK方法代碼示例

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


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

示例1: actionShow

 public function actionShow()
 {
     $auth = Auth::checkAuth();
     if ($auth) {
         $user = Users::findOneByPK($auth);
         $user->getProfile();
     }
     $course_id = $_GET['course_id'];
     $view = new View();
     //  $view->user_login = $user->user_login;
     // $view->user_group = $user->user_group;
     if (isset($course_id)) {
         $lessons = Lessons::findAllByColumn('parent_id', $course_id);
         $course = Courses::findOneByPK($course_id);
         $crumbs = Breadcrumbs::getCrumbs($course);
         $view->crumbs = $crumbs;
         $view->user = $user;
         $view->lessons = $lessons;
         $view->page_title = $course->name;
         $view->display('header.php');
         $view->display('lessons/list.php');
         $view->display('footer.php');
     } else {
         throw new ControllerException('Невозможно отобразить список уроков для данного курса', '404');
     }
 }
開發者ID:AK-VoronM,項目名稱:edu-znatok,代碼行數:26,代碼來源:LessonsController.php

示例2: actionShow

 public function actionShow()
 {
     $id = $_GET['id'];
     $auth = Auth::checkAuth();
     if ($auth) {
         $user = Users::findOneByPK($auth);
         $user->getProfile();
     }
     $courses = Courses::findAllByColumn('parent_id', $id);
     $view = new View();
     $view->user = $user;
     $view->courses = $courses;
     //  $view->user_login = $user->user_login;
     // $view->user_group = $user->user_group;
     $parent_course = Courses::findOneByPK($id);
     $crumbs = Breadcrumbs::getCrumbs($parent_course);
     $view->crumbs = $crumbs;
     $view->page_title = $parent_course->name;
     $view->display('header.php');
     if (isset($id)) {
         $view->display('courses/child-list.php');
     } else {
         $view->display('courses/list.php');
     }
     $view->display('footer.php');
 }
開發者ID:AK-VoronM,項目名稱:edu-znatok,代碼行數:26,代碼來源:CoursesController.php

示例3: actionTest

 public function actionTest()
 {
     $course = Courses::findOneByPK(11);
     $course->delete();
     var_dump($course);
     die;
 }
開發者ID:AK-VoronM,項目名稱:edu-znatok,代碼行數:7,代碼來源:IndexController.php

示例4: actionDel

 public function actionDel()
 {
     $id = $_GET['id'];
     if (!empty($id)) {
         $course = Courses::findOneByPK($id);
         if ($course) {
             $course->delete();
         } else {
             header('Location: ' . ADMIN_PATH);
         }
     } else {
         header('Location: ' . ADMIN_PATH);
     }
     header('Location: ' . ADMIN_PATH . '?ctrl=courses');
 }
開發者ID:AK-VoronM,項目名稱:edu-znatok,代碼行數:15,代碼來源:CoursesController.php


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