私はページを持っています:my-account/my-templates/view/1
-単にアイテムを表示するためにのid
フィールドを使用します1
私がやりたいのは、このアイテムのすべての値を取得して新しいアイテムを作成するコピーアクションを作成することです。
私はlink_to()
以下を保持するを持っています:
<?php echo link_to('Copy', '@copy_template', array('id' => $template->getId())); ?>
テンプレートのIDを渡します。
コピーアクションでこのIDにアクセスできますか?
編集:
行動:
public function executeViewTemplate(sfWebRequest $request)
{
$this->template = Doctrine_Core::getTable('UserTemplate')->getUserTemplate($request->getParameter('id'));
}
public function executeTemplateCopy(sfWebRequest $request)
{
$this->id = $request->getParameter('id');
// get the passed template id
}
テンプレート:
viewTemplateSuccess.php
<?php echo link_to('Copy', '@copy_template', array('id' => $sf_request->getParameter('id'), 'class'=>'button green')); ?>
templateCopySuccess.php
<?php echo "ID". $id;?> --> doesn't return the passed id