Skip to main content

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

  1. First, create the Zone for account.

  2. Add the base URL variables in the ./Config/bootstrap.php config file for define Medianova CDN in bootstrap.

CODE
...
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/');
...
  1. Use the HTML helper for image HtmlHelper::image.

<?php echo $this->Html->image('your-logo.png', array('alt' => 'Your Logo')); ?>

Will Output:

CODE
<img src="http://test.mncdn.com/img/medianova-logo.png" alt="Medianova Logo" />
  1. Use the HTML helper for CSS HtmlHelper::css

Will Output:

CODE
<link rel="stylesheet" type="text/css" href="http://test.mncdn.com/css/style.css" />
  1. Use the HTML helper for JavaScript HtmlHelper::script

Will Output:

CODE
<script type="text/javascript" href="http://test.mncdn.com/js/script.js"></script>
  1. Check the HTML source code to find out your assets whether (or not) loading from Medianova CDN.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.