O'Reilly logo

Programming with CodeIgniter MVC by Yehuda Zadik, Eli Orr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 2 – SSL helper

In this example, we will use the CI third-party SSL helper to enforce an https or HTTP URI request and response between CI and the browser. This example will be constructed from the following helpers:

  • application/helpers/ssl_helper.php: The CI helper for SSL that implements SSL on the links.
  • application/controllers/helpersslexample.php: This controller loads the helper and implements SSL on the links. The helper is loaded in the constructor.
    $this->load->helper('ssl');    
    
  • application/views/helper-ssl-view.php: This is the rendered view that SSL is implemented on.

Let us assume the URI to the project root is http://mydomain.com/myproject. http://mydomain.com/myproject/helpersslexample.

Tip

The source code is provided with this book ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required