App\Source\Factory\PageFactory::getPageByCode PHP 메소드

getPageByCode() 공개 정적인 메소드

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

Usage Example

예제 #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');
 }