Hyii2 background management system-menu, hyii2 Background Management System

Source: Internet
Author: User

Hyii2 background management system-menu, hyii2 Background Management System

Yii (yii-china.com)-hyii2 background management system-menu

Introduction

How to add a new menu in the hyii2 background management system? Many children's shoes that buy source code are often asked, and the menu I created is not displayed on the left-side menu bar. So today I will write this article to introduce how to configure the menu.

Add route

1. First, create a new controller, such as TestController, which has an index method (as shown below)

<?phpnamespace backend\controllers;use Yii;use yii\web\Controller;class TestController extends Controller{        public function actionIndex()    {        return $this->render('index');    }    }

Note: I will not post the corresponding views code, so I will simply render the page.

2. Go to System Management> route management. The following page is displayed. Add the two routes to the right. (If NO route is found, click the refresh button on the right and refresh the page)

As shown above, our route is added to the available route set so that the menu can be allocated to us.

Create menu

1. Create a level 1 menu "test menu", add anything, and save it directly (at this time, the menu we created will not appear on the left)

2. create a Level 2 menu "test sub-menu", select "test menu" for the parent level (the matching will be automatically retrieved if you enter Chinese), and add the route "test/index ", save the settings (for a super account, you can see the menu)

3. Add one sentence here. If it is not a super account, you must add the corresponding menu permissions to the user to see the "test menu" on the left.

Other configurations

1. Menu sorting:

Take "test menu" as an example. In the menu management, find "test menu", click "edit menu", and enter the sorting number (from small to large = top to bottom) in the ing options ), in this way, the menu can be sorted, as shown in

2.Menu icon:

The menu icon uses the font-awesome-4.4.0 icon, so you can search for the code of the icon online and add it to the level 1 menu in json format (for example, test menu) as shown in

So we can add the menu.

Menu demonstration

Related Article

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.