Slides from CodeIgniter / EE Nashville Talk http://www.calvinfroedge.com/slide-decks/codeigniter-ee-nashville-03-12.pdf
I was recently debugging an issue with Codeigniter Payments and HMVC. The issue was that config files were not being loaded if they were deeply nested – for example: config/payments/my_gateway.php The MX_Config path explodes the filepath provided on forward slashes, so if you do anything other than this->load->config(‘whatever’), the file you want won’t get loaded, [...]
Also posted in PHP, Programming |
Perfect for loading a random testimonial, banner image, etc. A quick helper for your coding pleasure = ) First, create your helper (helpers/randomview_helper.php). Here are the contents: <?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’); /** * Random view */ function get_random_view($fullpath, $viewpath) { $file = str_replace(‘.php’, ”, random_element(get_filenames($fullpath))); return $viewpath.$file; } Notice [...]
Also posted in Programming |
UPDATE: Since writing this blog post, I’ve released a new library which replaces this one, using the CodeIgniter Sparks system. You can find it here: http://github.com/calvinfroedge/codeigniter-payments I am currently supporting 6 payment gateways, and should have several more added very soon. Thanks for reading! NOTE: You can skip reading the post and get right to [...]
Also posted in Career, Programming |