2014-03-06 89 views
0

錯誤:在/usr/share/php5/Zend/Controller/Dispatcher/Standard.php:248堆棧跟蹤:#中帶有消息'Invalid controller specified(phonenumber)'的異常'Zend_Controller_Dispatcher_Exception' 0 /usr/share/php5/Zend/Controller/Front.php(954):Zend_Controller_Dispatcher_Standard-> dispatch(Object(Zend_Controller_Request_Http),Object(Zend_Controller_Response_Http))#1/usr/share/php5/Zend/Application/Bootstrap/Bootstrap .php(97):Zend_Controller_Front-> dispatch()#2 /usr/share/php5/Zend/Application.php(366):Zend_Application_Bootstrap_Bootstrap-> run()#3/home/bina/public_html/telco-portal-testing /public/index.php(22):Zend_Application-> run()#4 {main} 在這裏我想重定向phonenumbers控制器的addNew動作並且在這裏我想傳遞csv文件的數據 if(!empty($ files )){ $ name =($ files ['csvfile'] ['tmp_name']); $ row = 1; $ handle = fopen($ name,「r」); ($ data = fgetcsv($ handle,1000,「,」))!== FALSE if {$ handle!== FALSE} { $ num = count($ data); // echo「我想重定向到另一個控制器的動作

$ num line in line $ row:

\ n」; $ row ++; ($ c = 0; $ c < $ num; $ C++){ { enter code here echo $ data [$ c]; } } fclose($ handle); } // $ this - > _ forward('addNew','PhoneNumber'); $ this - > _ forward('addnew','phonenumber',null,array($ data));

回答

0

試試這個:

$this->_redirect('/module/controller/action/'); 
0

你可以嘗試這樣的..

$this->_redirect(array('controller'=>'cotroller_name','action' => 'action_name')); 

我不熟悉並且與Zend framwork ....我想說的介紹CakePHP的基礎.... 。但我認爲它可能正常工作........

0

你可以像這樣使用助手類,儘管你沒有提到你正在使用的框架的哪一個。

$this->_helper->redirector->gotoRoute(array('controller'=> 'controllerName','action' =>'actionName')); 

exit(); 

希望增加一些。

相關問題