このエラーが発生しています
キー「0」を持つ配列のキー「getPageTitle」は、2 行目の DprocMainBundle:Dproc:single.html.twig に存在しません
2行目 :{{ page.getPageTitle }}
私のエンティティファイル
<?php
namespace Dproc\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @IgnoreAnnotation("fn")
*
*/
/**
* @ORM\Entity
* @ORM\Table(name="pages")
*/
class Pages
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $Id;
/**
* @ORM\Column(name="page_title", type="text")
*/
protected $pageTitle;
/**
* @ORM\Column(name="page_content", type="text")
*/
protected $pageContent;
/**
* @ORM\Column(name="page_category", type="text")
*/
protected $pageCategory;
/**
* Get Id
*
* @return integer
*/
public function getId()
{
return $this->Id;
}
/**
* Set page_title
*
* @param string $pageTitle
* @return Pages
*/
public function setPageTitle($pageTitle)
{
$this->pageTitle = $pageTitle;
return $this;
}
/**
* Get page_title
*
* @return string
*/
public function getPageTitle()
{
return $this->pageTitle;
}
/**
* Set page_content
*
* @param string $pageContent
* @return Pages
*/
public function setPageContent($pageContent)
{
$this->pageContent = $pageContent;
return $this;
}
/**
* Get page_content
*
* @return string
*/
public function getPageContent()
{
return $this->pageContent;
}
/**
* Set page_category
*
* @param string $pageCategory
* @return Pages
*/
public function setPageCategory($pageCategory)
{
$this->pageCategory = $pageCategory;
return $this;
}
/**
* Get page_category
*
* @return string
*/
public function getPageCategory()
{
return $this->pageCategory;
}
}
コントローラ
public function IndexAction($slug)
{
$page = $this->getDoctrine()
->getRepository('DprocMainBundle:Pages')
->findByPageTitle($slug);
if (!$page) {
throw $this->createNotFoundException('No product found for slug '.$slug);
}
//print_r($page);
return $this->render('DprocMainBundle:Dproc:single.html.twig',array('page' => $page));
}
私が間違っているのは、getter メソッド getPageTitle をどのように呼び出すべきですか?
ありがとう