简体   繁体   English

cackphp具有同一页面的多个分页错误:发生内部错误

[英]cackphp multiple pagination with same page Error: An Internal Error Has Occurred

My system has users with different role. 我的系统具有不同角色的用户。 I want show all users in same page in separate tables. 我想在同一页面的单独表格中显示所有用户。 So i did following things. 所以我做了以下事情。

User Model (User.php) 用户模型(User.php)

App::uses('AppModel', 'Model');

class User extends AppModel {

    public $useTable = 'users';

}

AUser model (Auser.php) AUser模型(Auser.php)

App::uses('User', 'Model');

class Auser extends User {

}

BUser model (Buser.php) BUser模型(Buser.php)

App::uses('User', 'Model');

class Buser extends User {

}

UsersController.php UsersController.php

App::uses('Auser', 'Model');
App::uses('Buser', 'Model');

class UsersController extends AppController {

    public function index() {
        $Auser = new Auser();
        $Buser = new Buser();

        $this->paginate = array(
            'Auser' => array(
                'conditions' => array('Auser.role' => 0),
                'limit' => 5
            ), 
            'Buser' => array(
                'conditions' => array('Buser.role' => 1),
                'limit' => 5
            ),           
        );

        $this->set('ausers', $this->paginate('Auser'));
        $this->set('busers', $this->paginate('Buser'));


 }
}

But it show following error. 但是它显示以下错误。

Error: An Internal Error Has Occurred. 错误:发生内部错误。

What is the issue? 有什么问题

error comma and how to load models is so 错误逗号以及如何加载模型是这样

$this->loadModel('Auser');

so: 所以:

class UsersController extends AppController {

    public function index() {
        $this->loadModel('Auser');
        $this->loadModel('Buser');
        $this->paginate = array(
            'Auser' => array(
                'conditions' => array('Auser.role' => 0),
                'limit' => 5
            ), 
            'Buser' => array(
                'conditions' => array('Buser.role' => 1),
                'limit' => 5
            )
        );

        $this->set('ausers', $this->paginate('Auser'));
        $this->set('busers', $this->paginate('Buser'));


 }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HTTP错误500.0-内部服务器错误该页面无法显示,因为发生了内部服务器错误 - HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred 贝宝沙盒:发生内部服务错误 - Paypal Sandbox: An internal service error has occurred PHPMailler错误(由于发生内部服务器错误,因此无法显示该页面。) - PHPMailler error (The page cannot be displayed because an internal server error has occurred.) 由于FastCGI进程意外退出,导致“由于发生内部服务器错误而无法显示该页面。” - “The page cannot be displayed because an internal server error has occurred.” as a result of The FastCGI process exited unexpectedly 将Salesforce SOAP API与PHP结合使用时发生错误-“发生内部错误” - Error using Salesforce SOAP API with PHP - “An internal error has occurred” 没有任何启用错误报告的选项,克服了“由于发生内部服务器错误而无法显示该页面。” - Getting over the “The page cannot be displayed because an internal server error has occurred.” without any option to enable error reporting 登录“发生错误” - Login “An Error has Occurred” Yii2-错误#1-发生内部服务器错误 - Yii2 - Error #1 - An internal server error occurred 同一页面中的多个symfony分页 - symfony pagination multiple in same page 橙色 HRMS 显示“发生内部错误” - Orange HRMS gives 'Internal Error Occurred'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM