本文整理匯總了PHP中Program::getAllPrograms方法的典型用法代碼示例。如果您正苦於以下問題:PHP Program::getAllPrograms方法的具體用法?PHP Program::getAllPrograms怎麽用?PHP Program::getAllPrograms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Program
的用法示例。
在下文中一共展示了Program::getAllPrograms方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formToEditCourse
/**
* Function to load the page of a course that will be updated
* @param int $id
*/
public function formToEditCourse($courseId)
{
$this->load->model('course_model');
$course = $this->course_model->getCourseById($courseId);
$user = new Usuario();
$userToBeSecretaries = $user->getUsersToBeSecretaries();
if ($userToBeSecretaries !== FALSE) {
foreach ($userToBeSecretaries as $user) {
$formUserSecretary[$user['id']] = $user['name'];
}
} else {
$formUserSecretary = FALSE;
}
$course_controller = new Course();
$secretaryRegistered = $course_controller->getCourseSecrecretary($course['id_course']);
$course_types = $this->db->get('course_type')->result_array();
foreach ($course_types as $ct) {
$formCourseType[$ct['id']] = $ct['description'];
}
$originalCourseType = $this->course_model->getCourseTypeByCourseId($courseId);
$originalCourseTypeId = $originalCourseType['id'];
$program = new Program();
$registeredPrograms = $program->getAllPrograms();
if ($registeredPrograms !== FALSE) {
foreach ($registeredPrograms as $currentProgram) {
$registeredProgramsForm[$currentProgram['id_program']] = $currentProgram['program_name'];
}
}
$data = array('course' => $course, 'formUserSecretary' => $formUserSecretary, 'secretary_registered' => $secretaryRegistered, 'form_course_types' => $formCourseType, 'original_course_type' => $originalCourseTypeId, 'registeredPrograms' => $registeredProgramsForm);
loadTemplateSafelyByPermission("cursos", 'course/update_course', $data);
}
示例2: allList
public function allList($request, $response)
{/*{{{*/
$response->programs = Program::getAllPrograms();
}/*}}}*/