Welcome Guest, Not a member yet? Register   Sign In
Object-Oriented Design Patterns in CodeIgniter
#6

[eluser]nikefido[/eluser]
[quote author="bluecarrot16" date="1230216565"]Alright. Yeah, I knew how to instantiate the class in PHP, I was just confused about the right way to load it in CodeIgniter. The "Helper or Plugin" part is what I was looking for. Considering the amount of hoop-jumping CI does in the Loader library (looked through the source the other day, just for kicks), I thought there must be a better answer than require_once()-ing in the middle of your controller somewhere. This will make the class globally available, yes?[/quote]

A way around the "hoop jumping" is to use PHP 5's __autoload

However you need to implement that carefully (most likely within a factory class, or in CI's case, overriding some functionality in the loader class)


Messages In This Thread
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 12-24-2008, 06:11 PM
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 12-25-2008, 02:34 AM
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 12-25-2008, 02:49 AM
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 12-25-2008, 04:02 AM
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 12-25-2008, 04:04 AM
Object-Oriented Design Patterns in CodeIgniter - by El Forum - 01-04-2009, 01:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB