本文整理汇总了PHP中Lesson::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Lesson::toString方法的具体用法?PHP Lesson::toString怎么用?PHP Lesson::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lesson
的用法示例。
在下文中一共展示了Lesson::toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Lesson
<?php
require_once '../Course.Class.php';
echo 'Test Lesson Class: </br>';
$lesson = new Lesson(array('type' => 'LEC', 'group' => 'FS2', 'time' => new LessonTime(array('startTime' => '0830', 'endTime' => '0930', 'wkDay' => 'mon')), 'venue' => 'LT1'));
echo 'Test Case 1: a new lesson created, </br>';
echo $lesson->toString();
echo '</br></br>';
echo 'Test Course Class: </br>';
echo 'Test case 1, getInstanceWithCourseInfo: </br>';
$course = Course::getInstanceWithCourseInfo(array('code' => 'CZ2001', 'index' => '1000', 'name' => 'Shit Course', 'au' => '3', 'lessons' => array($lesson)));
echo $course->toString() . '</br>';
echo 'Test case 2, getInstanceAuto: </br>';
$course = Course::getInstanceAuto(array('code' => 'CZ2001', 'index' => '10733', 'year' => '2013', 'sem' => '1'));
if (!$course) {
echo 'cannot create an instance.';
} else {
echo $course->toString();
}
示例2: Lesson
<?php
include "Spyc.php";
include "Lesson";
$lesson1 = new Lesson("IDM", "i50", 2, "mathieu.acher@inria.fr");
$lesson2 = new Lesson("AOC", "i52", 2, "noel.plouzeau@univ-rennes1.fr");
$lessons = array("lesson 1" => $lesson1->toString(), "lesson 2" => $lesson2->toString());
$sp = new Spyc();
$yaml = Spyc::YAMLDump($lessons, 4, 100);
$fic = fopen('resultat', 'r+');
var_dump($sp);
fputs($fic, $yaml);
fclose($fic);