在管理生成器symfony之前执行过滤器链

时间:2012-05-30 17:17:20

标签: filter symfony-1.4 admin generator apostrophe-cms

在使用admin生成器调用动作构建之前,我需要调用添加到过滤器链的过滤器。 但似乎在管理生成器之前没有执行过滤器链。

有解决方法吗?

编辑:我正在使用撇号沙箱。我需要在运行时更改数据库连接,因为每个客户端有一个数据库,我在过滤器中执行此操作。但对于使用管理生成器的页面,未调用过滤器,我收到以下错误。

at Doctrine_Manager->getCurrentConnection()
in SF_ROOT_DIR\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Manager.php line 558 ...
at Doctrine_Manager->getConnectionForComponent('Tag')
in SF_ROOT_DIR\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Core.php line 1090 ...
at Doctrine_Core::getTable('Tag')
in SF_ROOT_DIR\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\generator\sfDoctrineGenerator.class.php line 41 ...
at sfDoctrineGenerator->configure()
in SF_ROOT_DIR\lib\vendor\symfony\lib\generator\sfModelGenerator.class.php line 56 ...
at sfModelGenerator->generate(array('model_class' => 'Tag', 'theme' => 'aAdmin', 'non_verbose_templates' => 1, 'with_show' => , 'singular' => null, 'plural' => null, 'route_prefix' => 'a_tag_admin', 'with_doctrine_route' => 1, 'config' => array('list' => array('sort' => array('name', 'asc'), 'title' => 'Tags Admin', 'display' => array('=name', 'tag_aBlogPost', 'tag_aEvent', 'tag_aMediaItem', 'tag_aPage'), 'fields' => array('name' => array('label' => 'Tag'), 'tag_aPage' => array('label' => 'Pages'), 'tag_aMediaItem' => array('label' => 'Media'), 'tag_aEvent' => array('label' => 'Events'), 'tag_aBlogPost' => array('label' => 'Blog'), 'tab_aEvent' => array('label' => 'aEvent')), 'object_actions' => array(), 'actions' => array('new' => array('label' => '<span class="icon"></span> New Tag', 'action' => 'new', 'params' => array('class' => 'a-btn big icon a-add')), 'clean' => array('label' => '<span class="icon"></span> Clean Tags', 'action' => 'clean', 'params' => array('class' => 'a-btn big a-show-busy')))), 'form' => array('class' => 'aTagForm'), 'filter' => null, 'edit' => array('title' => 'Edit Tag'), 'new' => array('title' => 'New Tag')), 'moduleName' => 'aTagAdmin'))
in SF_ROOT_DIR\lib\vendor\symfony\lib\generator\sfGeneratorManager.class.php line 113 ...
at sfGeneratorManager->generate('aTagAdminGenerator', array('model_class' => 'Tag', 'theme' => 'aAdmin', 'non_verbose_templates' => 1, 'with_show' => , 'singular' => null, 'plural' => null, 'route_prefix' => 'a_tag_admin', 'with_doctrine_route' => 1, 'config' => array('list' => array('sort' => array('name', 'asc'), 'title' => 'Tags Admin', 'display' => array('=name', 'tag_aBlogPost', 'tag_aEvent', 'tag_aMediaItem', 'tag_aPage'), 'fields' => array('name' => array('label' => 'Tag'), 'tag_aPage' => array('label' => 'Pages'), 'tag_aMediaItem' => array('label' => 'Media'), 'tag_aEvent' => array('label' => 'Events'), 'tag_aBlogPost' => array('label' => 'Blog'), 'tab_aEvent' => array('label' => 'aEvent')), 'object_actions' => array(), 'actions' => array('new' => array('label' => '<span class="icon"></span> New Tag', 'action' => 'new', 'params' => array('class' => 'a-btn big icon a-add')), 'clean' => array('label' => '<span class="icon"></span> Clean Tags', 'action' => 'clean', 'params' => array('class' => 'a-btn big a-show-busy')))), 'form' => array('class' => 'aTagForm'), 'filter' => null, 'edit' => array('title' => 'Edit Tag'), 'new' => array('title' => 'New Tag')), 'moduleName' => 'aTagAdmin'))
in SF_ROOT_DIR\lib\vendor\symfony\lib\config\sfGeneratorConfigHandler.class.php line 82 ...
at sfGeneratorConfigHandler::getContent(object('sfGeneratorManager'), 'aTagAdminGenerator', array('model_class' => 'Tag', 'theme' => 'aAdmin', 'non_verbose_templates' => 1, 'with_show' => , 'singular' => null, 'plural' => null, 'route_prefix' => 'a_tag_admin', 'with_doctrine_route' => 1, 'config' => array('list' => array('sort' => array('name', 'asc'), 'title' => 'Tags Admin', 'display' => array('=name', 'tag_aBlogPost', 'tag_aEvent', 'tag_aMediaItem', 'tag_aPage'), 'fields' => array('name' => array('label' => 'Tag'), 'tag_aPage' => array('label' => 'Pages'), 'tag_aMediaItem' => array('label' => 'Media'), 'tag_aEvent' => array('label' => 'Events'), 'tag_aBlogPost' => array('label' => 'Blog'), 'tab_aEvent' => array('label' => 'aEvent')), 'object_actions' => array(), 'actions' => array('new' => array('label' => '<span class="icon"></span> New Tag', 'action' => 'new', 'params' => array('class' => 'a-btn big icon a-add')), 'clean' => array('label' => '<span class="icon"></span> Clean Tags', 'action' => 'clean', 'params' => array('class' => 'a-btn big a-show-busy')))), 'form' => array('class' => 'aTagForm'), 'filter' => null, 'edit' => array('title' => 'Edit Tag'), 'new' => array('title' => 'New Tag')), 'moduleName' => 'aTagAdmin'))
in SF_ROOT_DIR\lib\vendor\symfony\lib\config\sfGeneratorConfigHandler.class.php line 75 ...
at sfGeneratorConfigHandler->execute(array('C:/wamp/www/sfprojects/asandbox/plugins/apostrophePlugin/modules/aTagAdmin/config/generator.yml', 'C:\wamp\www\sfprojects\asandbox\apps\frontend/modules/aTagAdmin/config/generator.yml'))
in SF_ROOT_DIR\lib\vendor\symfony\lib\config\sfConfigCache.class.php line 108 ...
at sfConfigCache->callHandler('modules/aTagAdmin/config/generator.yml', array('C:/wamp/www/sfprojects/asandbox/plugins/apostrophePlugin/modules/aTagAdmin/config/generator.yml', 'C:\wamp\www\sfprojects\asandbox\apps\frontend/modules/aTagAdmin/config/generator.yml'), 'C:\wamp\www\sfprojects\asandbox\cache\frontend\dev\config/modules_aTagAdmin_config_generator.yml.php')
in SF_ROOT_DIR\lib\vendor\symfony\lib\config\sfConfigCache.class.php line 197 ...
at sfConfigCache->checkConfig('modules/aTagAdmin/config/generator.yml', 1)
in SF_ROOT_DIR\lib\vendor\symfony\lib\config\sfConfigCache.class.php line 249 ...
at sfConfigCache->import('modules/aTagAdmin/config/generator.yml', , 1)
in SF_ROOT_DIR\lib\vendor\symfony\lib\controller\sfController.class.php line 186 ...
at sfController->forward('aTagAdmin', 'index')
in SF_ROOT_DIR\lib\vendor\symfony\lib\controller\sfFrontWebController.class.php line 48 ...
at sfFrontWebController->dispatch()
in SF_ROOT_DIR\lib\vendor\symfony\lib\util\sfContext.class.php line 170 ...
at sfContext->dispatch()
in SF_ROOT_DIR\web\index.php line 10 ...

0 个答案:

没有答案