App\Source\Factory\PageFactory::getPageByCode PHP Method

getPageByCode() public static method

public static getPageByCode ( $code )
    public static function getPageByCode($code)
    {
        return Pages::where('code', $code)->where('active', 1)->first();
        return new \stdClass();
    }

Usage Example

Ejemplo n.º 1
0
 public function detailAction(request $req, $res, $args)
 {
     if ($args['pageCode']) {
         $this->data['pageData'] = PageFactory::getPageByCode($args['pageCode']);
     } else {
         $this->data['pageData'] = PageFactory::getPageWithRequest($req);
     }
     $this->setRequestResult($req, $res);
     $this->render('public\\main\\pages\\detail_page.twig');
 }