.. highlight:: php .. index:: pair: plugin; bsDoctrineRuleHidablePlugin .. _bsDoctrineRuleHidablePlugin: bsDoctrineRuleHidablePlugin ********************************************* Behavior: bsRuleHidable --------------------------------------------- Adds "rule_hide" column to the model. When empty the record is always visible. If it contains a key from sfConfig / app_bsDoctrineRuleHidablePlugin_rules then the "bs_model_query.get_base_query" event filters only records with valid rules. Rules are configured in app.yml:: bsDoctrineRuleHidablePlugin: choices: "": only_zcu: Pouze pro ZČU only_muni: Pouze pro MUNI rules: only_zcu: -: type: request_parameter_equal key: skin value: zcu only_muni: -: type: request_parameter_not_equal key: skin value: zcu Available rule types: request_parameter_equal, request_parameter_not_equal, config_equal, config_not_equal. Skin can be easily set as a request parameter by hand-made filter:: class pcSkinFilter extends sfFilter { public function execute($filterChain) { // Execute this filter only once if ($this->isFirstCall()) { $request = $this->getContext()->getRequest(); if(strpos(strtolower($request->getHost()), 'muni.cz')!==false) { $request->setParameter('skin', 'muni'); } else { $request->setParameter('skin', 'zcu'); } } // Execute next filter $filterChain->execute(); } } Page model is using this behavior now. It can handle multiple homepages (see retrieveHomepage method) when text_key is set to "homepage" for multiple pages (but only one visible after filtering by this behavior).