CodeIgniter2.2.0-An error occurred when calling load in the Controller. thinkphp calls the controller.

Source: Internet
Author: User
Tags mssqlserver php error

CodeIgniter2.2.0-An error occurred when calling load in the Controller. thinkphp calls the controller.

The following error is reported:

helloA PHP Error was encounteredSeverity: NoticeMessage: Undefined property: Test::$loadFilename: controllers/test.phpLine Number: 9Fatal error: Call to a member function view() on a non-object in D:\xampp\htdocs\citest\application\controllers\test.php on line 9

The Code is as follows:

<? Php if (! Defined ('basepath') exit ('no direct script access allowed'); class Test extends CI_Controller {public function test (){
// Here is the root cause of the error echo 'hello';} public function index () {$ this-> load-> view ('test/Index ');} public function about () {$ this-> load-> view ('test/about');} protected function test1 () {echo 'test protected function ';} private function hello () {echo 'hello, ci';} public function test2 () {$ this-> test1 (); echo '<br/> '; $ this-> hello ();}}

What is wrong? Because I have rewritten the test controller constructor, the public method with the same class name and the _ construct method have the same function, after rewriting, the instantiation of anything in the parent class of CI_Controller is gone, and it must be instantiated by itself.

In addition to removing a method with the same name as a class, the following method is also used:

public function test(){echo 'hello';parent::__construct();}public function index(){$this->load->view('test/index');}

So there is no problem.

After three years, I used codeigniter again and forgot many things...


When installing SQL2000, the following error occurs: "MSSQLServer service controller operation failed: 1726 remote process call failed". How can this problem be solved?

MSSQLSERVER service Failure Case

Fault symptom
Using SQL Server Service Manager to start MSSQLServer does not respond, and it is no problem to start MSDTC. When you use <service> in the control panel, the system prompts "MSSQLServer service cannot be started. Error 2140: an internal Windows NT error occurs ."

Cause
After inquiry, the operator learned that in Enterprise Manager, a parameter in startup parameters in the SERVER property is deleted, and the SQL SERVER cannot be started.

Solution
In ms-dos, enter c: \ mssql7 \ binn and execute

Sqlservr-d c: \ mssql7 \ data \ master. mdf-e c: \ mssql7 \ log \ errorlog-l c: \ mssql7 \ data \ mastlog. ldf

About one minute later, when the message displays Using 'xpstar. dll 'version' 1998. 11.13 'to execute extended stored procedure 'SP _ msgetversion '. the ms-dos window cannot be closed, Enterprise Manager is opened, Startup parameters in the SERVER Properties window is opened, and Parameters are added in the Startup parameters window:

-Dc: \ mssql7 \ data \ master. mdf
-Ec: \ mssql7 \ log \ errorlog
-Lc: \ mssql7 \ data \ mastlog. ldf

Close the MS-DOS window and start the Service with SQL Server Service Manager.

The above is to repair in SQL7, for SQL2000, fault phenomenon and operation method is basically the same, the difference is that the prompt information in the MS-DOS method is not the same, in addition, the file path is changed to c: \ program files \ microsoft SQL server \ mssql, and the rest are the same.

In php, how does the controller of the MVC Architecture obtain the result returned by the underlying layer?

Haha, your jump is executed in the class, and the calling method outside will jump internally. If you want to customize it, change the method in the class to the following position:
******************** *******/
Header ("Location: ../View/admin_home.php"); this Location does not need to be changed to return true

Header ("Location: ../View/user_login.php? LoginProving = passWordError "); do not change this location to return false;

Here is the place submitted above
********************* ******/
$ LoginProving-> userNameProving ($ userName, $ passWord); changed to $ result = $ LoginProving-> userNameProving ($ userName, $ passWord );
In this way, you can determine whether the logon is successful. if ($ result) {successful jump link} else {error jump link}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.