[eluser]Aaron Wallentine[/eluser]
Thanks, Tom.
That's basically what I did.
Here's what I have:
file: application/config/AW_forms.php
Code:
$config['reqd_img_url'] = 'images/reqd_star.gif';
$config['error_img_url'] = 'images/err_cross.gif';
file: application/libraries/AW_forms.php
Code:
class AW_forms {
protected $reqd_img_url = '/images/reqd_star.gif';
protected $error_img_url = '/images/err_cross.gif';
function __construct($params = array()) {
echo "hello I am the AW_forms constructor ...";
echo "<pre>\n\$params:\n";
print_r($params);
echo "</pre>\n";
}
file: application/config/autoload.php
Code:
$autoload['libraries'] = array('database', 'AW_forms');
// ...
$autoload['config'] = array('AW_forms');
I even tried auto-loading the config file just in case that would make a difference.
But in my output I'm consistently getting:
Code:
hello I am the AW_forms constructor ...
$params:
Array
(
)
Indicating that those params from the config file aren't being passed into the constructor.
Does it make a difference that I'm autoloading the library instead of loading it manually?
Or perhaps the fact that the second letter of the library/class/config file is capitalized?
Or that I'm using __construct() instead of the PHP 4 way of making constructor functions? (I'm using PHP 5 so that shouldn't matter, I'd think)
I'll experiment with those things and see if they make a difference.