本文整理汇总了PHP中Classes::getClassBySubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Classes::getClassBySubject方法的具体用法?PHP Classes::getClassBySubject怎么用?PHP Classes::getClassBySubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Classes
的用法示例。
在下文中一共展示了Classes::getClassBySubject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Classes
//add a class
$class->addClass("Calculus I", "Math");
unset($class);
//get class from db
$class2 = new Classes("Calculus I");
//get subject for class
$my_subject = $class2->getSubject();
printf("Calculus I subject is: %s\n", $my_subject);
//get A to Z class list
$orderedArray = $class2->getAZClassList();
printf("Ordered Classes: \n");
foreach ($orderedArray as $class_val) {
printf("%s\n", $class_val);
}
//get A to Z class list for specific subject
$orderedArray = $class2->getClassBySubject("Math");
printf("Ordered Classes by Subject - Math: \n");
foreach ($orderedArray as $class_val) {
printf("%s\n", $class_val);
}
////////////////////////////
//Document UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING Document UNIT TESTS\n");
printf("/////////////////////////////////\n");
//construct empty document
$document = new Document();
//add a document
$document->createDocument("kmassey", "Distributed Client Server Prog", "Computer Science", "Test 1 Study Guide", ".pdf", "fake/path");
//delete document
示例2: Subject
session_start();
//print_r($_SESSION);
?>
<?php
foreach (glob("apps/studyhall/models/*.php") as $filename) {
include_once $filename;
}
$subject = new Subject();
$all_subs = $subject->getAZSubjects();
$classes = new Classes();
$dict = [];
foreach ($all_subs as $s) {
$dict[$s] = $classes->getClassBySubject($s);
}
?>
<form role="form" action="../documents/uploadDoc" method="post" enctype="multipart/form-data">
<TABLE>
<TR>
<TD>Document Subject:</TD>
<TD>
<div class="form-group">
<label for="sel1"></label>
<select class="form-control" id="sel1" name="subject">
<option value="lel" selected>---Select Subject---</option>
<?php
foreach ($all_subs as $subs) {