Welcome Guest, Not a member yet? Register   Sign In
I use CI setting library a lot but i miss one thing !!!

(This post was last modified: 02-04-2024, 12:38 AM by luckmoshy.)

Hi All, I missed something here and I don't know yet,I propose it would be good to get the key in the array property like

PHP Code:
service('settings')->set('App.siteName.titleone''My Great Site'); /* == class, property array titleone ,titletwo 

Thank you
Codeigniter First, Codeigniter Then You!!


Hi, I use CI setting library too and I think I know what you mean. You want to access the array elements by using dot notation, right? Like this:

PHP Code:
echo service('settings')->get('App.siteName.titleone'); // prints 'My Great Site'

Unfortunately, I don't think the library supports this feature yet. You have to use the array index instead, like this:

PHP Code:
echo service('settings')->get('App.siteName')[0]; // prints 'My Great Site'

Hope this helps!

Theme © iAndrew 2016 - Forum software by © MyBB