My site I have some content can be voted (+/-). It is working fine now, when all content has its own voter. Now I m looking for a way to create a single voting bundle with a entity(votedModel,votedId, user, vote). Basically the bundle is ready. My problem is how to use it. I d like to be able to do something like:
class ... extends Controller {
function showAction(Request $request,$id) {
...
$voter=new Voter( myCOntentType ,$id,$userid);
...
return $this->render( ... , array( voter =>$voter->getVoter(),...))
}
}
选民意见。
但是,我对如何确切开始感到困惑。 我试图以这种方式呼吁其他控制者,但能够创造选民。
它使用<代码>voter=$this->forward( Voterbundle NewAction,ome (id=>$id,user =>$user)->getContent();
。 但我想到了这 t。
我认为我的做法是错误的,我可能需要这样做。 我无法找到办法。