symfony1 - in Symfony, Frontend App, Using one of Module's form on another Module -


i building project symfony. blog-like web site. need implement: writing comment every article. every comment must moderationed editors etc.

everything ready. have backend, use group, perms. on. need comment form on article's show page.

my question can use comment module's newsuccess temp. if yes, how? when copy , paste content of newsuccess, not working evenif conf.

do know there way use comment module's form @ article module? , how can configure it?

thanks spend time read -maybe answer (;-

just create form in controller:

public function executeshowarticle(sfwebrequest $request) {    // assume weve retrieved , set $this->article   $comment = new comment();   $comment->setarticle($this->article);   $this->commentform = new commentform($comment);  } 

then can use echo $commentform in template article. if customizing layout of comment form move form partial , include_partial('comment/form', array('form' => $commentform); article view. alternatively make componet instead of using straight partial... like:

// in commentcomponents.class.php public function executearticlecommentform() {    $comment = new comment();    $comment->setarticle($this->article);    $this->form = new commentform($comment); }  // in article/showarticlesuccess.php <?php include_component('comment', 'articlecommentform', array('article' => $article)); ?> 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -