PHP code example of fbeen / simplecmsbundle
1. Go to this page and download the library: Download fbeen/simplecmsbundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fbeen / simplecmsbundle example snippets
/**
* @Route("/", name="homepage")
*/
public function indexAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$homepage = $em->getRepository('FbeenSimpleCmsBundle:Content')->findCompleteContent('homepage');
if (!$homepage) {
throw $this->createNotFoundException('No homepage configured');
}
$newsitems = $em->getRepository('AppBundle:Newsitem')->findFrontpageNews()->getResult();
return $this->render('default/index.html.twig', array(
'content' => $homepage,
'newsitems' => $newsitems,
));
}