Exemplo n.º 1
0
    public function testaddCss()
    {
        $css = <<<CSS
<style>
body {
  font-size: 100%;
}

a:focus {
  outline-offset: -2px;
}
</style>
CSS;
        $file = "/tmp/file1.css";
        file_put_contents($file, $css);
        //set modification time to a known value
        touch($file, 5000);
        Layout::addCss([$file]);
        $layout = new Layout(null, [], [$file]);
        $this->assertCount(1, $layout->getCssFiles());
        Layout::addCss([$file]);
        $this->assertCount(1, $layout->getCssFiles());
        $this->assertEquals("/css/5000_541e754eec404b8f7e5659038f70bb31.css", $layout->getCssScript());
    }
Exemplo n.º 2
0
 public function endInLineCss()
 {
     if (!Edge::app()->request->isAjax()) {
         $content = ob_get_clean();
         Layout::addInlineCss($content);
     }
 }
Exemplo n.º 3
0
 /**
  * Ends output buffer for inline styles and adds the content to the Layout class
  */
 public function endInLineCss()
 {
     $content = ob_get_clean();
     Layout::addInlineCss($content);
 }