0

In my config.ini file given

customer.login.test = "test case" 
customer.login.support[] = "abel"
customer.login.support[] = "justin"
customer.login.support[] = "leon" 

I tried to access it in zend action helper function as

$config = \Zend_Registry::get("config");
echo $config->customer->login->test; // Outputs as "test case"

print_r($config->customer->login->support); // No Result

print_r($config->customer->login->support->toArray()); // Gives Error

ERROR: Call to a member function toArray() on a non-object

How to correct this problem?

EDIT:

support[] = "abel"
support[] = "justin"
support[] = "leon" 

In zend action helper function

print_r($config->support->toArray());

Above print_r statement gives me a correct array. How this happens?

Justin John
  • 9,223
  • 14
  • 70
  • 129

1 Answers1

1

I've just tried your code. It works fine. It looks like you don't set customer.login.support[].

This can happen if you load another section of config file (e.g. testing instead of development) which also have customer.login.test but doesn't have customer.login.support[]

ainokna
  • 855
  • 10
  • 18
  • No, I have `customer.login.support[]` development section itself. If I try with `support[]`, it is working nice. – Justin John Sep 03 '12 at 05:48