CI gets the two-dimensional configuration array in the custom configuration file

Source: Internet
Author: User

CI gets the two-dimensional configuration array in the custom configuration file:
Such as:
The following configuration is available in the admin.php configuration file:
$config [' Admin_menu '] [] = Array (
' Name ' = ' Product management ',
' C ' = ' goods ',
' A ' = ' lists ',
' Icon ' = ' icon-gift ',
' Item ' = Array (
Commodity
0 = = Array (' name ' = = ' Product list ', ' c ' = ' = ' goods ', ' a ' = ' lists ', ' display ' = + 1, ' icon ' = ') ',
7 = = Array (' name ' = ' commodity query ', ' c ' = ' = ' goods ', ' a ' = ' goods_search ', ' display ' = + 0, ' icon ' = = '),
1 = = Array (' name ' + ' product add ', ' c ' = ' + ' goods ', ' a ' = ' + ' Add ', ' display ' = + 0, ' icon ' = = '),
2 = = Array (' name ' = ' product edit ', ' c ' = ' = ' goods ', ' a ' = ' = ' edit ', ' display ' = + 0, ' icon ' = '),

)
);

$config [' Admin_menu '] [] = Array (
' Name ' = ' product category ',
' C ' = ' goods_category ',
' A ' = ' lists ',
' Icon ' = ' icon-group ',
' Item ' = Array (
Classification
3 = = Array (' name ' = = ' commodity category ', ' c ' = ' goods_category ', ' a ' = ' lists ', ' display ' = + 1, ' icon ' = '),
4 = = Array (' name ' = ' Add ' category ', ' c ' = ' + ' goods_category ', ' a ' = ' + ' Add ', ' display ' = + 0, ' icon ' = = '),
8 = = Array (' name ' = ' edit category ', ' c ' = ' = ' goods_category ', ' a ' = ' = ' edit ', ' display ' = + 0, ' icon ' = = '),

)
);

Invoke the contents of the configuration file in the view file:
/* $CI = &get_instance ();
$CI->load->config (' admin ');
$admin _menu = Config_item (' Admin_menu '); */
$this->config->load (' admin ', TRUE);
$admin _menu = $expertid = $this->config->item (' Admin_menu ', ' admin ');
echo "<br>aname:". Print_r ($admin _menu);

CI gets the two-dimensional configuration array in the custom configuration file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.