0

だから、私は従った:

opencart でカスタム管理ページを作成するには?

これは、私の OpenCart v1.5.6 ショップにページを追加しようとする試みです。

<?
class ControllerCommonHelloworld extends Controller { 
public function index(){
            // VARS
            $template="common/hello.tpl"; // .tpl location and file
    $this->load->model('common/hello');
    $this->template = ''.$template.'';
    $this->children = array(
        'common/header',
        'common/footer'
    );      
    $this->response->setOutput($this->render());
    }
}
?>

しかし、新しいページを開くと、これが供給されます:

load->model('common/hello'); $this->template = ''.$template.''; $this->children = array('common/header', 'common/footer' ); $this->response->setOutput($this->render()); } }?>
( ! ) Fatal error: Class 'Controllercommonhelloworld' not found in ------\store\system\engine\front.php on line 39
Call Stack
#   Time    Memory  Function    Location
1   0.0015  303736  {main}( )   ..\index.php:0
2   0.0634  2285056 Front->dispatch( )  ..\index.php:166
3   0.0663  2439760 Front->execute( )   ..\front.php:29`

私が知る限り、このエラーは、helloworld.phpというファイルがあるにもかかわらず、「ControllerCommonHelloworld」という名前のクラスがないことを示しています

私はこれらの両方を持っており、すべてのタイプのケースの組み合わせを試し、ファイルを移動しました...

このエラーが表示される可能性がある他の理由を知っている人はいますか? または、私が見逃した可能性のある他の何かを見ることができますか?

4

1 に答える 1

0

お使いのサーバーは、php ショート タグを使用できないようです。<?に変更<?php- PHP はそのファイルを PHP ファイルとしてロードしないため、クラスは存在しません。に変更する<?phpと動作します

于 2013-09-18T17:00:43.540 に答える