Ben bir kez çağırdığınızda neden bir denetleyici bir eylem yöntemi iki kez idam olurdu?

0 Cevap php

Ben tarayıcı ve basın içine belirli bir rota yazarken bir PHP / Kohana uygulamasında, girmek once, örneğin:

http://localhost/test/importmanager/import_csv

bu belirli denetleyicisi eylem yöntemi kod yürütülür twice:

public function action_import_csv()
{
    helpers::debug('in import csv action', __FILE__, __LINE__);
}

çıktı:

2011-01-19 14:58:14:/data/domains/test/importmanager.php, line 27: [in import csv action] 2011-01-19 14:58:14:/data/domains/test/importmanager.php, line 27: [in import csv action]

Why is this code being executed twice and how can I find out the call stack at this point, i.e. what is calling this method a second time?

Addendum:

@ O1iver, burada tüm denetleyici bulunuyor:

<?php
class Controller_Backend_Application_Importmanager extends Backend_Controller
{
    public function action_index()
    {
        $view = new View('backend/application/importmanager');

        $smart_worksheets = array();
        $raw_files = glob('/data/original_excel/*.*');
        if (count($raw_files) > 0)
        {
            foreach ($raw_files as $raw_file)
            {
                $smart_import_file = new Backend_Application_Smartimportfile($raw_file);
                $smart_worksheets = $smart_import_file->add_smart_worksheets_to($smart_worksheets); 
            }
        }
        $view->set('smart_worksheets', $smart_worksheets);
        $this->request->response = $view;
    }

    public function action_import_csv()
    {
        debug_print_backtrace();
        echo '----------------------------------------------------------------';
        helpers::debug('in import csv action', __FILE__, __LINE__);
        //helpers::showCallStack();
    }

    public function action_import_excel()
    {
        helpers::debug('in import excel action', __FILE__, __LINE__);
    }
}

0 Cevap