本文整理汇总了PHP中PageController类的典型用法代码示例。如果您正苦于以下问题:PHP PageController类的具体用法?PHP PageController怎么用?PHP PageController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionOne
public function actionOne()
{
$id = isset($_GET['id']) ? $_GET['id'] : 1;
$view = new View();
$page = new PageController();
$view->assign('item', News::getOne($id));
$view->assign('links', $page->createLink($this->ctrl));
$view->display($this->view_one);
}
示例2: run
function run()
{
DB::connect();
//determin controller
switch ($_GET['ctrl']) {
case 'page':
$ctrl = new PageController();
break;
case 'wine':
$ctrl = new WineController();
break;
case 'response':
$ctrl = new ResponseController();
break;
case 'report':
$ctrl = new ReportController();
break;
case 'dp':
$ctrl = new DianPingController();
break;
default:
$ctrl = new PageController();
}
return $ctrl->dispatch($_GET['action'] . "Action");
DB::close();
}
示例3: renderView
public function renderView()
{
if (!isset($_SESSION['cart'])) {
$cart = new Cart();
$_SESSION['cart'] = serialize($cart);
}
foreach ($this->model->getUris() as $key => $value) {
if (preg_match("#^{$value}\$#", $this->uriView)) {
if ($this->model->getView($key) === "PageView") {
$pagecontroller = new PageController($this->additionalParam);
$pagecontroller->renderView();
} else {
if ($this->model->getView($key) === "ProductView") {
$productscontroller = new ProductsController();
$productscontroller->renderView();
} else {
if ($this->model->getView($key) === "SingleProductView") {
$singleproductcontroller = new SingleProductController($this->additionalParam);
$singleproductcontroller->renderView();
} else {
if ($this->model->getView($key) === "LoginView") {
$logincontroller = new LoginController($this->additionalParam);
$logincontroller->renderView();
} else {
if ($this->model->getView($key) === "CustomerView") {
$customercontroller = new CustomerController();
$customercontroller->renderView();
} else {
if ($this->model->getView($key) === "CartView") {
$cartcontroller = new CartController($this->additionalParam);
$cartcontroller->renderView();
} else {
if ($this->model->getView($key) === "ContactView") {
$contactcontroller = new ContactController($this->additionalParam);
$contactcontroller->renderView();
} else {
if ($this->model->getView($key) === "RegisterView") {
$registrationcontroller = new RegistrationController($this->additionalParam);
$registrationcontroller->renderView();
} else {
if ($this->model->getView($key) === "CheckoutView") {
$checkoutcontroller = new CheckoutController($this->additionalParam);
$checkoutcontroller->renderView();
} else {
$useView = $this->model->getView($key);
$view = new $useView();
$view->render();
}
}
}
}
}
}
}
}
}
}
}
}
示例4: getController
public function getController()
{
$controllerClass = $this->ClassName . 'Controller';
if (ClassManifest::has_class($controllerClass)) {
$controller = new $controllerClass();
} else {
$controller = new PageController();
}
$controller->setRecord($this);
return $controller;
}
示例5: controlGestion
/**
* Validates if there aren't any errors at the image, the rombinoscope or the password.
**/
public function controlGestion()
{
$pageController = new PageController();
$erreur = $pageController->uploadPhoto();
$erreur2 = $pageController->uploadTrombi();
$erreur3 = $pageController->modifyPassword();
if ($erreur == 0 && $erreur2 == 0 && $erreur3 == 0) {
$accountModel = new AccountModel();
$accountModel->uploadInfoUser();
} else {
header('Location: gestion.php');
}
}
示例6: __construct
/** Construtor responsavel por selecionar o tipo de banco **/
public function __construct()
{
parent::__construct();
$this->pageController = PageController::getInstance();
//$propertiesDom = new PropertiesDom('conf/properties.xml');
//$this->picture_directory = $propertiesDom->getPropertie("path");
}
示例7: index
/**
* 公告列表
*/
public function index()
{
$search = I('get.search');
// 拼接搜索条件
$news = D('News');
// 调用分页控制器实例分页功能
$page = new PageController();
$count = $page->getCount('title', $search, $news);
$show = $page->show($count);
$list = $page->page('title', $search, $news);
// 向模板中分配数据及显示模板
$this->assign('title', '新闻列表');
$this->assign('count', $count);
$this->assign('page', $show);
$this->assign('info', $list);
$this->display();
}
示例8: index
/**
* 建议列表
*/
public function index()
{
$search = I('get.search');
// 拼接搜索条件
$uid = I('get.id');
$advice = D('Advice');
// 调用分页控制器实例分页功能(注意写入的字段和数据库中的字段必须一致)
$page = new PageController();
if (!$uid) {
// 所有用户的分类列表
// $info = D('LogCate') -> select();
$count = $page->getCount('name', $search, $advice);
$show = $page->show($count);
$list = $page->page('name', $search, $advice);
} else {
// 具体用户的分类列表
$count = $page->getCount('name', $search, $advice, 'uid=' . $uid);
$show = $page->show($count);
$list = $page->page('name', $search, $advice, 'uid=' . $uid);
$name = I('get.name');
$this->assign('name', $name);
}
//$data = D('Advice') -> where(array('uid'=>$id)) -> select();
$this->assign('count', $count);
$this->assign('page', $show);
$this->assign('info', $list);
$this->display();
}
示例9: __construct
/**
* __construct
*
* PageController constructor
*
* @param string $template
*/
public function __construct($template = null, $post_type = null)
{
$this->post_type = $post_type ? $post_type : get_post_type();
if (!$template) {
// try to guess the view for custom post types
$template = sprintf("single%s.twig", $this->post_type === 'post' ? '' : "-{$this->post_type}");
}
parent::__construct(array($template, 'single.twig'));
}
示例10: admin_login
/**
* Log user in using the standard Chamilo way of logging in.
* Useful when the normal login screen is removed from the user interface
* - replaced by Shibboleth login - and user want to login using a standard
* account
*/
public function admin_login()
{
$title = get_lang('internal_login');
if (Shibboleth::session()->is_logged_in()) {
$message = get_lang('already_logged_in');
Shibboleth::display()->message_page($message, $title);
}
$html = PageController::displayLoginForm();
Shibboleth::display()->page($html, $title);
}
示例11: ActionCreateQuiz
public static function ActionCreateQuiz()
{
if (ModeratorModel::isModerator() and isset($_POST['id']) and isset($_POST['number'])) {
$variables = ['template' => 'panel.php', 'panel_template' => 'moderator_create_quiz.php', 'id' => $_POST['id'], 'number' => $_POST['number']];
$variables = array_merge_recursive(PageController::getMainVariables(), $variables);
Template::render('template.php', $variables);
} else {
header('Location: ' . $_SERVER['HTTP_REFERER']);
}
}
示例12: ActionThemes
public static function ActionThemes()
{
if (AdminModel::isAdmin()) {
$variables = ['template' => 'panel.php', 'panel_template' => 'admin_themes.php', 'themes' => AdminModel::getThemes()];
$variables = array_merge_recursive(PageController::getMainVariables(), $variables);
Template::render('template.php', $variables);
} else {
header('Location: ' . $_SERVER['HTTP_REFERER']);
}
}
示例13: ActionProfile
public static function ActionProfile()
{
$user = UserModel::getUser(UserModel::getUserId());
if (UserModel::isUserLoggedIn()) {
$variables = ['template' => 'profile.php', 'links' => ['profile.css'], 'scripts' => ['fileUploader.js'], 'themes' => AdminModel::getThemes(), 'profile' => ['id' => UserModel::getUserId(), 'email' => $user['email'], 'about' => $user['about']]];
$variables = array_replace_recursive(PageController::getMainVariables(), $variables);
Template::render('template.php', $variables);
} else {
header("Location: " . $_SERVER['HTTP_REFERER']);
}
}
示例14: showlist
/**
* 前台目录列表
*/
public function showlist()
{
$search = I('get.search');
// 拼接搜索条件
$dir = D('Dir');
// 调用分页控制器实例分页功能(注意写入的字段和数据库中的字段必须一致)
$page = new PageController();
$count = $page->getCount('name', $search, $dir, 'flag=1');
$show = $page->show($count);
$list = $page->page('name', $search, $dir, 'flag=1');
// // 获取前台目录列表信息
// $info = D('Dir') -> where(array('flag'=>'1')) -> select();
// 向模板中分配数据及显示模板
$this->assign('title', '前台目录列表');
$this->assign('flag', '1');
$this->assign('info', $list);
$this->assign('count', $count);
$this->assign('page', $show);
$this->display('Dir/index');
}
示例15: __construct
public function __construct()
{
parent::__construct();
global $container;
$this->activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']);
}