2010-10-20 32 views
0

有人使用nooku框架?Joomla - nooku框架 - 什麼是調度?

與切入點

defined('_JEXEC') or die('Restricted access'); 
if(!defined('KOOWA')){ 
    JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); 
    return; 
} 
$view = KRequest::get('get.view', 'cmd', 'hellos'); 
echo "<pre>"; 
var_dump(KFactory::get('admin::com.hello.dispatcher')); 

KFactory::get('admin::com.hello.dispatcher')->dispatch($view); 

時的var_dump我得到一個對象,但我沒有看到調度()

回答

1

s all about nooku magic!You don噸需要在你的根組件文件夾中創建dispatch.php除非你需要覆蓋默認的nooku調度程序行爲。 默認調度位於com_default,你會需要它來輸入驗證碼:

class ComMycomponentDispatcher extends ComDefaultDispatcherDefault {} 

ComDefaultDispatcherDefault延伸KDispatcherDefault延伸KDispatcherAbstract延伸KControllerAbstract延伸的kobject並實現KObjectIdentifiable。