Php 如何看待学说结果
我正在使用Symfony,在我的控制器中,我具有以下功能:Php 如何看待学说结果,php,symfony,doctrine-orm,Php,Symfony,Doctrine Orm,我正在使用Symfony,在我的控制器中,我具有以下功能: /** * @Route("/place/{id}", name="place") */ public function placeAction( $id ) { $em = $this->getDoctrine()->getManager(); $place = $em->getRepository( "RoAllgemeinBundle:Place" )->find($id);
/**
* @Route("/place/{id}", name="place")
*/
public function placeAction( $id )
{
$em = $this->getDoctrine()->getManager();
$place = $em->getRepository( "RoAllgemeinBundle:Place" )->find($id);
return $this->render( "RoAllgemeinBundle:Default:place.html.twig",
array(
"place"=>$place
));
}
在我的小树枝上,我想看到匹配的地方
<h1>{{ description }}</h1>
但是我有一个专栏,上面有名字的描述
在实体类中,此选项为:
/**
* @var string
*/
private $description;
/**
* Set description
*
* @param string $description
* @return Place
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
我放弃了什么吗?改为:
<h1>{{ place.description }}</h1>
{{place.description}
<h1>{{ place.description }}</h1>