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
    ...
    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/');
    ...
    
  3. 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" />
  4. 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" />
  5. 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>
    
    
  6. Check the HTML source code to find out your assets whether (or not) loading from Medianova CDN

Was this post helpful?