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 3 – building your own helper

This example uses a helper to download a very large file, of 200 MB, which can't be downloaded in one file reading.

This example will be constructed from the following helpers:

  • application/helpers/my_download_helper.php: This is the CI helper that is used to download a very large file
  • application/controllers/classg2.php: This is the controller that uses the my_download helper
  • application/views/classg2view.php: This is the view that has a link for the file download

Let us assume that the URI to the project root is http://mydomain.com/myproject. Hence the URI to execute the auth controller for login will be http://mydomain.com/myproject/classg2.

Tip

The source code is provided with this book via URLs.

The helper file ...

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