CodeIgniter Forums

Full Version: Upgrading to 3.1.11
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
1) Why do I keep getting


Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Login has a deprecated constructor in Login.php on line 3


class Login extends CI_Controller {

function login() {
parent::__construct();



Line 3 is the class and has a Capital L and the constructor has a lower case l






I can't get smarty to work. I am getting



An uncaught Exception was encountered
Type: SmartyException

Message: Unable to load template 'file:index.tpl'

Filename: application/third_party/smarty/libs/sysplugins/smarty_internal_template.php

Line Number: 195



The old original index.tpl is in the views/template folder

and I have


<?php defined('BASEPATH') OR exit('No direct script access allowed');

require_once(APPPATH . 'third_party/smarty/libs/Smarty.class.php');

class SmartyLibrary extends Smarty {

function __construct() {
parent::__construct();

// Define directories, used by Smarty:
$this->setTemplateDir(APPPATH . 'views/templates');
$this->setCompileDir(APPPATH . 'cache');
$this->setCacheDir(APPPATH . 'cache');
}
}




any ideas why? It is giving a 500 message but here is nothing in the error log about a 500 error. Thanks
You need to change these through your whole app.

PHP Code:
// change this
function login()
{
    parent::__construct();
}

// to this
function __construct()
{
    parent::__construct();

(11-22-2020, 02:59 AM)Knutsford Wrote: [ -> ]1) Why do I keep getting


Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Login has a deprecated constructor in Login.php on line 3


class Login extends CI_Controller {

function login() {
parent::__construct();



Line 3 is the class and has a Capital L and the constructor has a lower case l






I can't get smarty to work. I am getting



An uncaught Exception was encountered
Type: SmartyException

Message: Unable to load template 'file:index.tpl'

Filename: application/third_party/smarty/libs/sysplugins/smarty_internal_template.php

Line Number: 195



The old original index.tpl is in the views/template folder

and I have


<?php defined('BASEPATH') OR exit('No direct script access allowed');

require_once(APPPATH . 'third_party/smarty/libs/Smarty.class.php');

class SmartyLibrary extends Smarty {

function __construct() {
parent::__construct();

// Define directories, used by Smarty:
$this->setTemplateDir(APPPATH . 'views/templates');
$this->setCompileDir(APPPATH . 'cache');
$this->setCacheDir(APPPATH . 'cache');
}
}




any ideas why? It is giving a 500 message but here is nothing in the error log about a 500 error. Thanks

(11-22-2020, 03:21 AM)InsiteFX Wrote: [ -> ]You need to change these through your whole app.

PHP Code:
// change this
function login()
{
    parent::__construct();
}

// to this
function __construct()
{
    parent::__construct();
}









Ah ok that makes sense thanks



Any ideas why the template isn
't being found please? 
500 is a server error usually.

put this at the top of index.php remove it when your finished.

PHP Code:
ini_set('display_errors'1);
ini_set('display_startup_errors'1);
error_reporting(E_ALL);