Jump to content
Sign in to follow this  
Snakes911

[Решено] Ошибка при создании новой станицы

Recommended Posts

Создал новую страницу, которая по факту является копией страницы home:

 

В файле ".../controller/test/test.php" прописал: 

<?php  
class ControllerNewTest extends Controller {
	
    public function index() {
        $this->document->setTitle($this->config->get('config_title'));
        $this->document->setDescription($this->config->get('config_meta_description'));
        $this->data['heading_title'] = $this->config->get('config_title');
        if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/test/test.tpl')) {
            $this->template = $this->config->get('config_template') . '/template/test/test.tpl';
            $this->data['template'] = $this->config->get('config_template');
        } else {
            $this->template = 'default/template/test/test.tpl';
        }
        $this->children = array(
            'common/column_left',
            'common/column_right',
            'common/content_top',
            'common/content_bottom',
            'common/footer',
            'common/header'
        );                            
        $this->response->setOutput($this->render());
    }
}
?>

В файле ".../template/test/test.tpl" прописал:

<?php echo $header; ?>
<?php echo $column_left; ?>
<?php echo $column_right; ?>
      <div id="content">
           <?php echo $content_top; ?>
           <?php echo $content_bottom; ?>
     </div>
<?php echo $footer; ?>

Но при переходе по пути "site.ru/index.php?route=test/test" выходит ошибка: 

 

"Fatal error: Class 'Controllertesttest' not found in  /home/site/site.ru/docs/vqmod/vqcache/vq2-system_engine_front.php on line 39"

 

В чем может быть проблема? Немного погуглил, решения не нашел, но пишут что удаление vqmod ничего не меняет, т.е. дело не в нем..

Share this post


Link to post
Share on other sites

>> В файле ".../controller/test/test.

<?php  
class ControllerNewTest...
"Fatal error: Class 'Controllertesttest' not found...
найди 10 отличий.

Share this post


Link to post
Share on other sites

В файле controller/test/test.php

 

класс должен называться ControllerTestTest

Share this post


Link to post
Share on other sites

Действительно, благодарю. Ни в одном туториале по созданию новых страниц/схем не было указано что название контроллера должно быть соответствующее.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.