Symfony 1.4(Doctrine)管理生成器:如何通过url调用symfony 1.4 admin生成的过滤器选项

问题描述:

我有一个管理员生成的前端,其中有很多可用的过滤器选项。 我可以通过URL调用页面并为每个URL选择不同的过滤器选项吗?Symfony 1.4(Doctrine)管理生成器:如何通过url调用symfony 1.4 admin生成的过滤器选项

例如。 URL 1 = /客户/过滤器= caseworker_id = 2 URL 2 = /客户/过滤器= isActive = TRUE

我以前做的Symfony 1.0类似的东西,但无法找到做这件事1.4

正道

谢谢

您是否尝试过使用自动生成的filter操作?

public function executeFilter(sfWebRequest $request) 
{ 
    $this->setPage(1); 

    if ($request->hasParameter('_reset')) 
    { 
    $this->setFilters($this->configuration->getFilterDefaults()); 

    $this->redirect('@auto_brand_history'); 
    } 

    $this->filters = $this->configuration->getFilterForm($this->getFilters()); 

    $this->filters->bind($request->getParameter($this->filters->getName())); 
    if ($this->filters->isValid()) 
    { 
    $this->setFilters($this->filters->getValues()); 

    $this->redirect('@auto_brand_history'); 
    } 

    $this->pager = $this->getPager(); 
    $this->sort = $this->getSort(); 

    $this->setTemplate('index'); 
} 

似乎它可以与GET参数一起使用。

+0

我明白你的观点,并会着眼于实现这一点。我通过使用table_method(使用doctrine)和查询$ sf_User凭据来改变查询,在我当前的项目中找到了一条路。感谢您的意见:) – user601707 2011-02-09 20:52:38