Welcome Guest, Not a member yet? Register   Sign In
Upgrading to 3.1.11
#1

(This post was last modified: 11-22-2020, 03:06 AM by Knutsford.)

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
Reply
#2

You need to change these through your whole app.

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

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

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 11-22-2020, 03:36 AM by Knutsford.)

(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? 
Reply
#4

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); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB