本文整理汇总了PHP中Lesson::getLesson方法的典型用法代码示例。如果您正苦于以下问题:PHP Lesson::getLesson方法的具体用法?PHP Lesson::getLesson怎么用?PHP Lesson::getLesson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lesson
的用法示例。
在下文中一共展示了Lesson::getLesson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = $this->secureString($_GET['id']);
$this->lesson = Lesson::getLesson($lessonId);
$this->course = Course::getCourseById($this->lesson->getCourseId());
$this->view = new TutorialAdminView($this->lesson, $this->course);
}
示例2: __construct
public function __construct()
{
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = $this->secureString($_GET['id']);
$this->lesson = Lesson::getLesson($lessonId);
if (!isset($this->lesson)) {
die("This lesson was not found!");
}
$this->course = Course::getCourseById($this->lesson->getCourseId());
$this->view = new ExerciseView($this->lesson, $this->course);
}
示例3: die
<?php
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = htmlspecialchars($_GET['id']);
$lessonId = DB::escapeString($lessonId);
$lesson = Lesson::getLesson($lessonId);
$course = Course::getCourseById($lesson->getCourseId());
if (!isset($lesson)) {
die("This lesson was not found!");
}
$courseId = $lesson->getCourseId();
$filePath = PAGE_DIR . "lessons/{$courseId}-{$lessonId}.html";
$exerciseComponent = '<div class="well ui">
<form action="' . ROOT_DIR . 'exercises/' . $lessonId . '" method="post">
<button type="submit" class="btn btn-default btn-block">' . I18n::t('lesson.startexercises') . '</button>
</form>
</div>';
// display content
echo '<ol class="breadcrumb">
<li><a href="' . ROOT_DIR . 'courseoverview">' . I18n::t('courseoverview.title') . '</a></li>
<li><a href="' . ROOT_DIR . 'course/' . $course->getId() . '">' . $course->getName(I18n::getLang()) . '</a></li>
<li class="active">' . $lesson->getName(I18n::getLang()) . '</li>
</ol>';
echo $exerciseComponent;
echo '<h1>' . $lesson->getName(I18n::getLang()) . '</h1>';
if (file_exists($filePath) && filesize($filePath) > 1) {
echo '<h2>Tutorial</h2>';
echo file_get_contents($filePath);
echo $exerciseComponent;