예제 #1
0
 public function testTemplateStore()
 {
     $store = Store::template();
     $this->assertInstanceOf(Store::class, $store);
     $this->assertEquals('http://localhost:8080/assets/img/pizza.png', $store->getUrl('img/pizza.png'));
     $this->assertEquals('http://www.example.com/pizza.png', $store->getUrl('http://www.example.com/pizza.png'));
     $storePath = $store->getPath('img/pizza.png');
     $realPath = APPPATH . 'Template' . DS . 'Default' . DS . 'img' . DS . 'pizza.png';
     $storePath = str_replace('\\', '/', $storePath);
     $realPath = str_replace('\\', '/', $realPath);
     $this->assertEquals($realPath, $storePath);
 }
예제 #2
0
파일: footer.php 프로젝트: arvici/framework
    <footer>
        <div class="container">
            <span class="text-muted">
                Test Pages, Arvici Framework.
            </span>
        </div>

        <div class="text-center">
            <img src="<?php 
echo \Arvici\Component\Asset\Store::template()->getUrl('img/pizza.png');
?>
" height="50" />
        </div>
    </footer>

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</body>

</html>