php - opencart custom controller not found
Get the solution ↓↓↓im trying to write a custom controller in my website i added a new folder named ticketing in "catalog/controller" directory then added a php file for the controller
<?
class ControllerTicketingTicket extends Controller{
public function index(){
var_dump("hi");
}
public function addticket(){
}
}
now when I'm trying to request the route "route=ticketing/ticket"
response
Fatal error: Uncaught Error: Class 'Controllerticketingticket' not found in myurl\system\storage\modification\system\engine\action.php on line 71
Answer
Solution:
You want to ruin OC framework. You are allowed use this folders:
$allowed = array(
'admin/controller/extension/',
'admin/language/',
'admin/model/extension/',
'admin/view/image/',
'admin/view/javascript/',
'admin/view/stylesheet/',
'admin/view/template/extension/',
'catalog/controller/extension/',
'catalog/language/',
'catalog/model/extension/',
'catalog/view/javascript/',
'catalog/view/theme/',
'system/config/',
'system/library/',
'image/catalog/'
);
For example if you need to create custom module you should add your custom module file for admin to:admin/controller/extension/module/ticketing/ticketing.php
and your file should start:
<?php
class ControllerExtensionModuleTicketingTicketing extends Controller {
The path and the extend should be with the same names and each word in a class must start in uppercase.
the same for the "catolog"
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: mark bundle as not supporting multiuse
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.