本文整理汇总了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) {