Click here to Skip to main content
14,937,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Writing a little shopping cart thing in raw php, but suddenly I get this problem.

(login file)


$Template = new Template(); //Problem is here "Undefined type "Template"


(Template class file)

//Template Class - handless all templating tasks (displaying templates, alerts, errors)

class Template
    function __construct() {}

    function load($url)

What I have tried:

I am building this shopping cart as a part of a "follow along" tutorial, which is several years old, I suppose the error is caused because modern php doesn't support what is used in older projects. But I'm not competent enough to figure out what it is exactly.
Updated 17-Dec-20 23:27pm

1 solution

include 'models/m_template.php';

PHP include and require[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900