本文整理匯總了PHP中Observer::stopObserving方法的典型用法代碼示例。如果您正苦於以下問題:PHP Observer::stopObserving方法的具體用法?PHP Observer::stopObserving怎麽用?PHP Observer::stopObserving使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Observer
的用法示例。
在下文中一共展示了Observer::stopObserving方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirector_catch_redirect
Plugin::setInfos(array(
'id' => 'redirector',
'title' => 'Redirector',
'description' => 'Provides an interface to manage redirects.',
'version' => '0.2.5',
'website' => 'http://www.github.com/realslacker/Redirector-Plugin',
'update_url' => 'http://www.brooksworks.com/plugin-versions.xml'
));
// setup observers
Behavior::add('page_not_found', '');
Observer::observe('page_requested', 'redirector_catch_redirect');
// allow Redirector to observe the "page_not_found" event before the "page_not_found" plugin
if (Plugin::isEnabled('page_not_found')) {
Observer::stopObserving('page_not_found', 'behavior_page_not_found');
Observer::observe('page_not_found', 'redirector_log_404');
Observer::observe('page_not_found', 'behavior_page_not_found');
}
else {
Observer::observe('page_not_found', 'redirector_log_404');
}
// load plugin classes into the system
AutoLoader::addFolder(dirname(__FILE__) . '/models');
// add the plugin's tab and controller
Plugin::addController('redirector', __('Redirector'),'redirector_view,redirector_new,redirector_edit,redirector_delete,redirector_settings');
// redirect urls already configured
function redirector_catch_redirect(&$args) {