Join Jon Peck for an in-depth discussion in this video Using a helper to perform tasks, part of Learning PHP CodeIgniter (2013).
Helper files are similar to libraries in that they're a collection of…functionality, but they're different in that they're not object oriented.…Instead, they're procedural functions that perform one specific task with no…dependence on any other function. Examples of helper function files include…a date helper, form helper and URL helper. Helper files aren't loaded by default.…So, if I wanted to use one, I'd have to explicitly load it from the controller…using the helper method. Similar to loading libraries, I can either…pass a string or an array as the argument. If I needed help getting a date, I just…use the string date, this -> load -> helper, date.…
If I wanted to load multiple helpers at once, I'd pass it in an array of strings…like date, form, url. Now, let's revisit that form, but this…time I'm going to use helpers.…
Starting with the what and why of CodeIgniter, Jon introduces key concepts such as the MVC pattern and libraries by demonstrating how to create static pages, then storing and displaying magazine info in a database. Advanced topics like classes and helpers are explored to validate user input, upload files, and much more. By creating a complete system, you'll have the foundation to build your own applications with CodeIgniter.
- What is CodeIgniter?
- Creating a static page controller
- Generating output with a view
- What is a model?
- Saving data with Active Records
- Creating forms
- Validating user input
- Listing records in tables
- Uploading images
- Viewing and deleting records