本文整理匯總了PHP中Course::getCourse方法的典型用法代碼示例。如果您正苦於以下問題:PHP Course::getCourse方法的具體用法?PHP Course::getCourse怎麽用?PHP Course::getCourse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Course
的用法示例。
在下文中一共展示了Course::getCourse方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
parent::boot($router);
/**
* Bind the course route.
*/
$router->bind('courses', function ($value, $route) {
$course = \Course::getCourse($value);
if ($course === null) {
throw new NotFoundHttpException();
}
return $course;
});
/**
* Bind the user route.
*/
$router->bind('users', function ($value, $route) {
$user = \User::getUser($value);
if ($user === null) {
throw new NotFoundHttpException();
}
return $user;
});
}
示例2: Course
<?php
/**
* Created by PhpStorm.
* User: Amali
* Date: 10/8/14
* Time: 2:17 PM
*/
require_once "course_view.php";
if (empty($_POST["Course"])) {
echo "Please Enter Course ID";
} else {
$cors = $_POST["Course"];
$course = new Course();
$course->getCourse("SELECT * FROM subject WHERE Course_Course_ID = '{$cors}'", $cors);
}