本文整理汇总了PHP中View::display方法的典型用法代码示例。如果您正苦于以下问题:PHP View::display方法的具体用法?PHP View::display怎么用?PHP View::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addedAction
protected function addedAction($title, $content)
{
ArticlesModel::add($title, $content);
$view = new View();
$view->item = $single_article;
$view->display('NewAddedArticle.php');
}
示例2: actionShowLesson
public function actionShowLesson()
{
$auth = Auth::checkAuth();
$view = new View();
$view->auth = $auth;
if (!isset($_GET['id'])) {
header("Location: /learns/");
}
if ($auth) {
$user = Auth::getUser();
$id = $_GET['id'];
$lesson = Lessons::getLesson($id);
$course = Courses::getCourse($lesson->course_id);
$lesson_prew = Lessons::getLessonByNumber($lesson->lesson_number - 1, $lesson->course_id);
$lesson_next = Lessons::getLessonByNumber($lesson->lesson_number + 1, $lesson->course_id);
$view->user_login = $user->user_login;
$view->user_group = $user->user_group;
$view->lesson = $lesson;
$view->course = $course;
$view->lesson_prew = $lesson_prew;
$view->lesson_next = $lesson_next;
$view->display('header.php');
$view->display('lessons/lesson_view.php');
$view->display('footer.php');
} else {
header("Location: /learns/");
}
}
示例3: actionShow
public function actionShow()
{
$id = $_GET['id'];
$auth = Auth::checkAuth();
if ($auth) {
$user = Users::findOneByPK($auth);
$user->getProfile();
}
$courses = Courses::findAllByColumn('parent_id', $id);
$view = new View();
$view->user = $user;
$view->courses = $courses;
// $view->user_login = $user->user_login;
// $view->user_group = $user->user_group;
$parent_course = Courses::findOneByPK($id);
$crumbs = Breadcrumbs::getCrumbs($parent_course);
$view->crumbs = $crumbs;
$view->page_title = $parent_course->name;
$view->display('header.php');
if (isset($id)) {
$view->display('courses/child-list.php');
} else {
$view->display('courses/list.php');
}
$view->display('footer.php');
}
示例4: display
/**
* 渲染模板
* @param string $tpl 模板路径,如果为空则用类名作为模板名
*/
protected function display($tpl = '', $data = [])
{
if ($tpl == '') {
$tpl = $this->_widgetName;
}
$tpl = '../' . $tpl;
$this->_view->display($tpl, $data);
}
示例5: actionAdd
public function actionAdd()
{
$courses = Courses::findAll();
$view = new View();
$view->courses = $courses;
$view->display('admin/header.php');
$view->display('admin/courses/add.php');
$view->display('admin/footer.php');
}
示例6: actionShow
public function actionShow()
{
$view = new View();
$lessons = Lessons::findAll();
$view->lessons = $lessons;
$view->display('admin/header.php');
$view->display('admin/lessons/list.php');
$view->display('admin/footer.php');
}
示例7: actionRegister
public function actionRegister()
{
$auth = Auth::checkAuth();
if (!$auth) {
$view = new View();
$view->display('header.php');
$view->display('auth/register.php');
$view->display('footer.php');
} else {
header("Location: " . BASE_PATH . 'users/');
}
}
示例8: actionEdit
public function actionEdit()
{
$auth = Auth::checkAuth();
if (!$auth) {
header("Location: " . BASE_PATH . 'auth/');
}
$user = Users::findOneByPK($auth);
$user->getProfile();
$view = new View();
$view->user = $user;
$view->display('header.php');
$view->display('users/edit_profile.php');
$view->display('footer.php');
}
示例9: actionPanel
public function actionPanel()
{
$auth = Auth::checkAuth();
$view = new View();
$view->auth = $auth;
if ($auth) {
$user = Auth::getUser();
$view->display('header.php');
$view->display('admin/main.php');
$view->display('footer.php');
$view->admin = $admin;
} else {
header("Location: /learns/");
}
}
示例10: actionJSTasks
public function actionJSTasks()
{
$task_list = Index::getTaskList();
$view = new View();
if (isset($_GET['task'])) {
$task = 'jstasks/' . $_GET['task'] . '.php';
} else {
$task = 'jstasks/tasklist.php';
}
$view->date = $date_start;
$view->task_list = $task_list;
$view->display('header.php');
$view->display($task);
$view->display('footer.php');
}
示例11: actionLesson
public function actionLesson()
{
$lesson_id = $_GET['lesson_id'];
$view = new View();
// $view->user_login = $user->user_login;
// $view->user_group = $user->user_group;
if (isset($lesson_id)) {
$view->display('header.php');
$view->display('lessons/lesson.php');
$view->display('footer.php');
} else {
header("HTTP/1.1 404 Not Found");
$view->display('errors/404.php');
}
}
示例12: messageAction
/**
* Messages Example
* @return null
*/
public function messageAction()
{
$View = new View('examples/message');
$View->assign('_title_', _('Message Examples'));
$View->assign('_message_', "Ejemplo de como abrir un mensaje desde el controlador");
$View->display();
}
示例13: display
public function display()
{
$model = $this->getModel();
$this->itemsTable = $model->getTable();
//$this->_layout= 'bs3';
parent::display();
}
示例14: action_generator
public function action_generator()
{
$series = Series::get_all();
$view = new View();
$view->series = $series;
$view->display('cards/cards_generator.php');
}
示例15: actionAll
public function actionAll()
{
$items = News::getAll();
$view = new View();
$view->items = $items;
$view->display('view.php');
}