本文整理汇总了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();
}/*}}}*/