używam filtr niestandardowy zbyt i wewnątrz tego filtra można pobrać aktualny moduł:
<?php
class customFilter extends sfFilter
{
public function execute ($filterChain)
{
$context = $this->getContext();
if ('moduleName' == $context->getModuleName())
{
// jump to the next filter
return $filterChain->execute();
}
// other stuff
}
}
W przeciwnym razie, można podać również wykluczone moduł wewnątrz pliku filters.yml
:
customFilter:
class: customFilter
param:
module_excluded: moduleName
i wewnątrz klasa:
<?php
class customFilter extends sfFilter
{
public function execute ($filterChain)
{
$context = $this->getContext();
if ($this->getParameter('module_excluded') == $context->getModuleName())
{
// jump to the next filter
return $filterChain->execute();
}
// other stuff
}
}
Świetnie, to działa dla mnie, ale są małe modyfikacje, aby ta współpraca de work ---> inside filters.yml ---> to "param:" nie "params:" –
Masz rację, naprawiłem to. – j0k