當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfEvent::getSubject方法代碼示例

本文整理匯總了PHP中sfEvent::getSubject方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfEvent::getSubject方法的具體用法?PHP sfEvent::getSubject怎麽用?PHP sfEvent::getSubject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfEvent的用法示例。


在下文中一共展示了sfEvent::getSubject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: listenToRoutingLoadConfigurationEvent

 public static function listenToRoutingLoadConfigurationEvent(sfEvent $event)
 {
     $event->getSubject()->prependRoute('izarus_advanced_layout_customize', new sfRoute('/customize/modules', array('module' => 'izarusAdvancedCustomize', 'action' => 'index')));
     $event->getSubject()->prependRoute('izarus_advanced_layout_users', new sfRoute('/customize/permissions', array('module' => 'izarusAdvancedCustomize', 'action' => 'permissions')));
     $event->getSubject()->prependRoute('izarus_advanced_layout_lateral', new sfRoute('/customize/lateral', array('module' => 'izarusAdvancedCustomize', 'action' => 'lateral')));
     $event->getSubject()->prependRoute('izarus_advanced_layout_select_profile', new sfRoute('/p', array('module' => 'izarusAdvancedCustomize', 'action' => 'selectProfile')));
 }
開發者ID:alexarenasf,項目名稱:izarusAdvancedLayoutPlugin,代碼行數:7,代碼來源:izarusAdvancedLayoutPluginRouting.class.php

示例2: listenToContextLoadedEvent

 public function listenToContextLoadedEvent(sfEvent $e)
 {
     $this->setBrowser($e->getSubject()->get('browser'));
     if (!$e->getSubject()->getI18n()->cultureExists($this->getCulture())) {
         $this->setCulture(sfConfig::get('sf_default_culture'));
     }
 }
開發者ID:jdart,項目名稱:diem,代碼行數:7,代碼來源:dmCoreUser.php

示例3: clearCache

 /**
  * Clears the super cache by listening to the task.cache.clear event.
  *
  * @param sfEvent An sfEvent instance
  */
 public static function clearCache(sfEvent $event)
 {
     $config = sfFilterConfigHandler::getConfiguration($event['app']->getConfigPaths('config/filters.yml'));
     $event->getSubject()->logSection('cache', 'Clearing super cache');
     // find super cache configuration
     $found = false;
     $cacheDir = 'cache';
     foreach ($config as $value) {
         if ('sfSuperCacheFilter' == $value['class']) {
             $found = true;
             if (isset($value['param']['cache_dir'])) {
                 $cacheDir = $value['param']['cache_dir'];
             }
             break;
         }
     }
     if ($found) {
         // clear the cache
         $cacheDir = sfConfig::get('sf_web_dir') . '/' . $cacheDir;
         if (is_dir($cacheDir)) {
             // remove cache files
             $event->getSubject()->getFilesystem()->remove(sfFinder::type('file')->ignore_version_control()->discard('.sf')->in($cacheDir));
         }
     }
 }
開發者ID:GustavoAdolfo,項目名稱:cmais-frontend-2,代碼行數:30,代碼來源:sfSuperCache.class.php

示例4: loadRoutes

 /**
  * Listens to routing.load_configuration
  *
  * @param sfEvent $event The routing.load_configuration event
  * @return void
  */
 public function loadRoutes(sfEvent $event)
 {
     $prefix = sfConfig::get('app_doctrine_menu_module_prefix', '/admin/menu');
     $event->getSubject()->prependRoute('io_doctrine_menu', new sfDoctrineRouteCollection(array('name' => 'io_doctrine_menu', 'model' => 'ioDoctrineMenuItem', 'module' => 'io_doctrine_menu', 'prefix_path' => $prefix, 'with_wildcard_routes' => true, 'collection_actions' => array(), 'requirements' => array())));
     $event->getSubject()->prependRoute('io_doctrine_menu_reorder', new sfDoctrineRoute($prefix . '/reorder/:id', array('module' => 'io_doctrine_menu', 'action' => 'reorder'), array('sf_method' => array('get')), array('model' => 'ioDoctrineMenuItem', 'type' => 'object')));
     $event->getSubject()->prependRoute('io_doctrine_menu_reorder_json', new sfDoctrineRoute($prefix . '/reorder/json/:id', array('module' => 'io_doctrine_menu', 'action' => 'json', 'sf_format' => 'json'), array('sf_method' => array('get')), array('model' => 'ioDoctrineMenuItem', 'type' => 'object')));
     $event->getSubject()->prependRoute('io_doctrine_menu_reorder_save', new sfDoctrineRoute($prefix . '/reorder/save/:id', array('module' => 'io_doctrine_menu', 'action' => 'saveJson'), array('sf_method' => array('post')), array('model' => 'ioDoctrineMenuItem', 'type' => 'object')));
 }
開發者ID:rafaelgou,項目名稱:ioDoctrineMenuPlugin,代碼行數:14,代碼來源:ioDoctrineMenuPluginConfiguration.class.php

示例5: run

 public function run(sfEvent $event)
 {
     $event->getSubject()->logSection('sympal', 'Clearing web cache folder');
     $cacheDir = sfConfig::get('sf_web_dir') . '/cache';
     if (is_dir($cacheDir)) {
         $event->getSubject()->getFilesystem()->remove(sfFinder::type('file')->ignore_version_control()->discard('.sf')->in($cacheDir));
     }
 }
開發者ID:slemoigne,項目名稱:sympal,代碼行數:8,代碼來源:sfSympalTaskClearCacheListener.class.php

示例6: listenToRoutingLoadConfigurationEvent

 /**
  * Listens to the routing.load_configuration event.
  *
  * @param sfEvent An sfEvent instance
  * @static
  */
 public static function listenToRoutingLoadConfigurationEvent(sfEvent $event)
 {
     // preprend our routes
     if (sfConfig::get('app_vkontakte_enable_register_routes')) {
         $event->getSubject()->prependRoute('sf_vkontakte_fetch_profiles', new sfRoute('/sf_vkontakte_fetch_profiles', array('module' => 'sfVkontakteFetch', 'action' => 'profiles')));
         $event->getSubject()->prependRoute('sf_vkontakte_upload_photo', new sfRoute('/sf_vkontakte_upload_photo', array('module' => 'sfVkontakteFetch', 'action' => 'uploadPhoto')));
     }
 }
開發者ID:vkapp,項目名稱:sfVkontaktePlugin,代碼行數:14,代碼來源:sfVkontakteListenerRouting.class.php

示例7: addRoute

 static public function addRoute(sfEvent $event)
 {
   $event->getSubject()->prependRoute('sf_jquery_form_validation',
                                      new sfRoute('/sfJqueryFormVal/:form',
                                                  array('module' => 'sfJqueryFormVal', 'action' => 'index')));
   $event->getSubject()->prependRoute('sf_jquery_form_remote',
                                      new sfRoute('/sfJqueryFormVal/remote/:form/:validator',
                                                  array('module' => 'sfJqueryFormVal', 'action' => 'remote')));
 }
開發者ID:romankallweit,項目名稱:swingmachine,代碼行數:9,代碼來源:sfJqueryFormValRouting.php

示例8: userSignedInListener

 static function userSignedInListener(sfEvent $event)
 {
     $user = $event->getSubject()->getUser();
     if ($user->hasAttribute('user.signed_in.continue_url') && $user->getAttribute('user.signed_in.continue_url')) {
         $url = $user->getAttribute('user.signed_in.continue_url');
         $user->setAttribute('user.signed_in.continue_url', false);
         $event->getSubject()->redirect($url);
     }
 }
開發者ID:vcgato29,項目名稱:poff,代碼行數:9,代碼來源:UserManagers.class.php

示例9: listenToContextLoadedEvent

 public function listenToContextLoadedEvent(sfEvent $e)
 {
     if ($this->configuration instanceof dmAdminApplicationConfiguration) {
         $e->getSubject()->getResponse()->addJavascript('dmCkEditorPlugin.adminLauncher')->addStylesheet('dmCkEditorPlugin.adminStyle');
     }
     /*
      * Add ckeditor.js & jquery.js to javascript compressor black list
      */
     $e->getSubject()->get('javascript_compressor')->addToBlackList(array('ckeditor.js', 'jquery.js'));
 }
開發者ID:vjousse,項目名稱:dmCkEditorPlugin,代碼行數:10,代碼來源:dmCkEditorPluginConfiguration.class.php

示例10: bootstrap

 /**
  * Listens to the sympal.load event
  */
 public function bootstrap(sfEvent $event)
 {
     $this->_sympalContext = $event->getSubject();
     $event->getSubject()->getApplicationConfiguration()->loadHelpers('SympalMenu');
     // Listen to sfSympalContent's change_content event
     $this->dispatcher->connect('sympal.content.set_content', array($event->getSubject()->getService('menu_manager'), 'listenContentSetContent'));
     // extend the component/action class
     $actions = new sfSympalMenuActions();
     $this->dispatcher->connect('component.method_not_found', array($actions, 'extend'));
 }
開發者ID:sympal,項目名稱:sympal,代碼行數:13,代碼來源:sfSympalMenuPluginConfiguration.class.php

示例11: clearSuperCache

 /**
  * clearSuperCache - clear supercache of minified assets
  *
  * @listen task.cache.clear
  *
  * @param  sfEvent $event
  * @return void
  */
 public static function clearSuperCache(sfEvent $event)
 {
     static $done = false;
     /* symfony send the task.cache.clear event once by app. */
     if (!$done) {
         $event->getSubject()->logSection('cache', 'Clearing sfDynamicsPlugin minified assets super cache');
         if (is_dir($cacheDir = self::getSuperCacheDir(true))) {
             $event->getSubject()->getFilesystem()->remove(sfFinder::type('file')->ignore_version_control()->discard(array('.sf', '.htaccess'))->in($cacheDir));
         }
         $done = true;
     }
 }
開發者ID:ericroge,項目名稱:sfdynamicsplugin,代碼行數:20,代碼來源:sfDynamicsCache.class.php

示例12: listenToSetupAfterEvent

 public function listenToSetupAfterEvent(sfEvent $event)
 {
     $this->cleanupUploads($event->getSubject()->getFilesystem());
     dmDb::table('DmMediaFolder')->checkRoot()->sync();
     dmDb::table('DmPage')->checkBasicPages();
     if (!sfConfig::get('dm_test_project_built') && $event['clear-db']) {
         $event->getSubject()->getContext()->get('filesystem')->sf('my:project-builder');
     }
     copy(dmOs::join(sfConfig::get('sf_data_dir'), 'db.sqlite'), dmOs::join(sfConfig::get('sf_data_dir'), 'fresh_db.sqlite'));
     $this->removeWebSymlinks();
     sfConfig::set('dm_test_project_built', true);
 }
開發者ID:jdart,項目名稱:diem,代碼行數:12,代碼來源:ProjectConfiguration.class.php

示例13: addRouteForNestedCommentAdmin

 static public function addRouteForNestedCommentAdmin(sfEvent $event)
 {
   $event->getSubject()->prependRoute('sf_nested_comment', new sfPropelORMRouteCollection(array(
     'name'                 => 'sf_nested_comment',
     'model'                => 'sfNestedComment',
     'module'               => 'sfNestedCommentAdmin',
     'prefix_path'          => 'sf_nested_comment',
     'with_wildcard_routes' => true,
     'requirements'         => array(),
   )));
   $event->getSubject()->prependRoute('sf_nested_comment_toggle_publish', new sfPropelORMRoute('/sf_nested_comment/:id/toggleApprove.:sf_format', array('module' => 'sfNestedCommentAdmin', 'action' => 'togglePublish', 'sf_format' => 'html'), array(), array('model' => 'sfNestedComment', 'type' => 'object')));
 }
開發者ID:nibsirahsieu,項目名稱:sfNestedCommentPlugin,代碼行數:12,代碼來源:sfNestedCommentRouting.class.php

示例14: listenToContextLoadFactories

 /**
  * Automatic plugin modules and helper loading
  *
  * @param  sfEvent  $event
  */
 public function listenToContextLoadFactories(sfEvent $event)
 {
     // Enable module automatically
     sfConfig::set('sf_enabled_modules', array_merge(sfConfig::get('sf_enabled_modules', array()), array('ioEditableContent')));
     // Load helper as well
     $event->getSubject()->getConfiguration()->loadHelpers(array('EditableContent'));
     // create the editable content service
     $this->_editableContentService = $this->_createEditableContentService($event->getSubject()->getUser());
     // load the editor assets
     if ($this->_editableContentService->shouldShowEditor()) {
         $this->_loadEditorAssets($event->getSubject());
     }
 }
開發者ID:kimbrelas,項目名稱:ioEditableContentPlugin,代碼行數:18,代碼來源:ioEditableContentPluginConfiguration.class.php

示例15: handleEvent

 public static function handleEvent(sfEvent $event)
 {
     switch ($event->getName()) {
         case 'paypal.ipn_success':
             $transaction = $event->getSubject();
             $message = sprintf('IPN Success | Reservation: %s', $transaction->parent_id);
             self::notifyPaypalEvent($message, $event['ipn_data']);
             break;
         case 'paypal.ipn_error':
             $message = sprintf('IPN Error |  %s', $event->getSubject());
             self::notifyPaypalEvent($message, $event['ipn_data']);
             break;
     }
 }
開發者ID:jmiridis,項目名稱:atcsf1,代碼行數:14,代碼來源:PaypalEventManager.class.php


注:本文中的sfEvent::getSubject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。