Reprinted address statement: http://blog.csdn.net/lin_wen_jun/article/details/5882026
In this example, you can add a custom travel information page in two steps.
1. Add an application MVC
Add an app/travel. App. php
And expand the mallbaseapp class.
Class travelapp extends mallbaseapp (){
Function Index (){
// Obtain related data
// Present the template travel.html
}
Function other (){
}
}
When such a class is written, you can use index. php? APP = Travel
Of course, you can define a function similar to other to use index. php? APP = Travel & act = Other
Add related language items
Modify ages/sc-utf-8/common. Lang. php (this file is used to display page information at the current location)
Add ages/sc-utf-8/travel. Lang. php (this file is to display the package in the travel view)
Add view files
Themes/mall/default/travel.html
2. Associate the template with the background Editor
1. In admin/APP/template. App. php
Found in approximately 309 rows
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
);
}
Add an array element
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
'Travel '=> site_url.'/index. php? APP = Travel ',
);
}
2. In versions/sc-utf-8/admin/template. Lang. php
Add an array element
'Travel '=> 'travel info page'
This is to edit the Template Name in the background template editing.
In this example, you can add a custom travel information page in two steps.
1. Add an application MVC
Add an app/travel. App. php
And expand the mallbaseapp class.
Class travelapp extends mallbaseapp (){
Function Index (){
// Obtain related data
// Present the template travel.html
}
Function other (){
}
}
When such a class is written, you can use index. php? APP = Travel
Of course, you can define a function similar to other to use index. php? APP = Travel & act = Other
Add related language items
Modify ages/sc-utf-8/common. Lang. php (this file is used to display page information at the current location)
Add ages/sc-utf-8/travel. Lang. php (this file is to display the package in the travel view)
Add view files
Themes/mall/default/travel.html
2. Associate the template with the background Editor
1. In admin/APP/template. App. php
Found in approximately 309 rows
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
);
}
Add an array element
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
'Travel '=> site_url.'/index. php? APP = Travel ',
);
}
2. In versions/sc-utf-8/admin/template. Lang. php
Add an array element
'Travel '=> 'travel info page'
This is to edit the Template Name in the background template editing.