1. Create a new app with commands
1 // ----- window Platform -----2 3 Run "site root/app/base/cmd.bat" directly 4 after the command line appears, enter dev:new app MyApp5 6// ----- Linux Platform ----- 7 8 terminal access to "site root/app/base" 9 run cmd dev:new app MyApp
2. After running, the command-line tool creates the App/myapp directory and generates the Services.xml and app.xml files.
3. Next we create a few basic necessary folders and files.
4.desktop.xml is the background menu "display" file. So we first modify the Desktop.xml, the configuration content is as follows:
1 <Desktop>2 <Permissions>3 <PermissionID= "MyApp"Workground= "Myapp.wrokground.test"Display= ' true '>My app</Permission>4 </Permissions>5 6 <Workgroundname= "Test App"ID= "Myapp.wrokground.test"Controller= "Admin_test"Action= "Index"Order= " the">7 <Menugroupname= "Test Management"> 8 <MenuController= ' Admin_test 'Action= ' Index 'Permission= ' MyApp 'Display= ' true 'Order= ' Ten '>Test List</Menu>9 <MenuController= ' Admin_test 'Action= ' Add 'Permission= ' MyApp 'Display= ' false 'Order= ' a '>Add test</Menu> Ten </Menugroup> One </Workground> A </Desktop>
Desktop.xml label of course more than that, in accordance with the rules of grammar, according to their own needs can be arbitrarily increased or decreased tags.
5.app basically have been built, below we test.
Create the site root/app/myapp/controller/admin/test.php content as follows:
1<?PHP2 classMyapp_ctl_admin_testextendsdesktop_controller{3 4 Public function__construct ($app){5Parent::__construct ($app);6 }7 functionindex () {8 $this->page (' admin/index.html ');9 //Some children's shoes here are the direct echo output. Like the following. This causes the left navigation bar to not appear.Ten //echo "Test"; One } A}
Create the site root/app/myapp/view/admin/index.html content as follows:
Test test test
6. Install the App
1 // ----- window Platform -----2 3 run the site root/app/base/cmd.bat4 directly After the command line appears, enter install MyApp5 6// ----- Linux Platform -----7 8 terminal go to "site root/app/base"9 run cmd install MyApp
7. Next visit your own site and you will see the following scene. The new app has been built for success.
Ecstore new App App