CMS\Page::is PHP Method

is() public method

Check extension.
public is ( string $ext ) : boolean
$ext string
return boolean
    public function is($ext)
    {
        return $this->getExtension() === $ext;
    }

Usage Example

Example #1
0
File: cms.php Project: sphido/cms
 /**
  * @return mixed|null|string
  * @throws \Exception
  */
 public function render()
 {
     trigger(Sphido::class . '::' . __FUNCTION__, $this->page, $this);
     // HTTP status code
     if ($code = isset($this->page->status) ? $this->page->status : null) {
         http_response_code($code);
     }
     // PHTML file execute
     if ($this->page->is('phtml')) {
         extract(get_object_vars($this), EXTR_SKIP);
         ob_start();
         require $this->page;
         return ob_get_clean();
     }
     return latte()->renderToString($this->page, get_object_vars($this));
 }