CakePHP Medianova CDN Entegrasyonu
CakePHP is an open-source framework, such as Zend, Laravel, and Symfony, developed with MVC (Model-View-Controller) logic and on PHP.
We have explained the CDN integration steps that support the CakePHP 2.4 version and higher versions for you.
Note: We recommend back up your files and database before they integrate
- First, create the Zone for account
- Add the base URL variables in the ./Config/bootstrap.php config file for define Medianova CDN in bootstrap
... Configure::write('App.imageBaseUrl', 'http://test.mncdn.com/img/'); Configure::write('App.cssBaseUrl', 'http://test.mncdn.com/css/'); Configure::write('App.jsBaseUrl', 'http://test.mncdn.com/js/'); ...
- Use the HTML helper for image HtmlHelper::image
<?php echo $this->Html->image('your-logo.png', array('alt' => 'Your Logo')); ?>
Will Output:
<img src="http://test.mncdn.com/img/medianova-logo.png" alt="Medianova Logo" />
- Use the HTML helper for CSS HtmlHelper::css
<?php echo $this->Html->css('your-css'); ?>
Will Output:
<link rel="stylesheet" type="text/css" href="http://test.mncdn.com/css/style.css" />
- Use the HTML helper for JavaScript HtmlHelper::script
<?php echo $this->Html->script('your-js'); ?>
Will Output:
<script type="text/javascript" href="http://test.mncdn.com/js/script.js"></script>
- Check the HTML source code to find out your assets whether (or not) loading from Medianova CDN
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.