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


PHP Teacher::initialize方法代碼示例

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


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

示例1: TeacherRepository

<?php

require_once 'models/teacher.class.php';
require_once 'repository/teacherrepository.class.php';
$repository = new TeacherRepository();
$teacher1 = new Teacher();
$teacher1->initialize(1, "Surendra", "Shakya", "surendrashakya@gmail.com", "Pulchowk", 23423432);
$repository->add($teacher1);
$teacher2 = new Teacher();
$teacher2->initialize(2, "Sajan", "Thapa", "thapasajan@gmail.com", "Bhaktapur", 3242342);
$repository->add($teacher2);
$teacher3 = new Teacher();
$teacher3->initialize(3, "Rajiv", "Shah", "rajivshah@gmail.com", "Satdobato", 32432423);
$repository->add($teacher3);
include_once 'includes/formvalidation.php';
?>

<?php 
include_once 'includes/header.php';
?>
		<tr>
			<th colspan="7" class="text-center">Teacher Info<button class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#add_teacher"><span class="glyphicon glyphicon-plus"></span></button></th>
		</tr>
		<tr>
			<th><input type="checkbox" id="select_all"/></th>
			<th>Id</th>
			<th>Full Name</th>
			<th>Email</th>
			<th>Address</th>
			<th>Contact</th>
			<th>Action</th>
開發者ID:shrsujan,項目名稱:leapfrog,代碼行數:31,代碼來源:teacher.php

示例2: Teacher

<?php

require_once "models/teacher.class.php";
require_once "repository/teacherrepository.class.php";
?>

<?php 
$teacher1 = new Teacher();
$teacher2 = new Teacher();
$teacher3 = new Teacher();
$teacher4 = new Teacher();
$teacherrepository = new TeacherRepository();
$teacher1->initialize(1, "dixanta", "shrestha", "dixanta@gmail.com", "php");
$teacher2->initialize(2, "ram", "shah", "dixanta@gmail.com", ".net");
$teacher3->initialize(3, "shyam", "malakar", "dixanta@gmail.com", "java");
$teacher4->initialize(4, "hari", "shrestha", "dixanta@gmail.com", "ruby");
$teacherrepository->add_teacher($teacher1);
$teacherrepository->add_teacher($teacher2);
$teacherrepository->add_teacher($teacher3);
$teacherrepository->add_teacher($teacher4);
?>


<?php 
include_once "header.php";
?>

<table class="table table-bordered table-hover table-striped">
	<tr>
		<th><input type="checkbox" name="checkbox" id="checkall"></th>
		<th>ID</th>
開發者ID:pratishshr,項目名稱:leapfrog,代碼行數:31,代碼來源:teacher.php

示例3: Teacher

<?php

if (isset($_POST['add'])) {
    $teacher = new Teacher();
    $teacher->initialize($_POST['id'], $_POST['first_name'], $_POST['last_name'], $_POST['email'], $_POST['address'], $_POST['contact'], $_POST['course']);
    $repository->add($teacher);
}
開發者ID:shrsujan,項目名稱:leapfrog,代碼行數:7,代碼來源:formvalidation.php


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