step1 左侧导航选择后,进入管理详情页(thinkphp/Examples/Rbac/Tpl/Public/menu.html),“新增”“编辑”“删除”等方法 代码步骤
1 页面封装控件imageBtn
thinkphp/Examples/Rbac/Tpl/Nationalnews/index.html
<html:imageBtn name="add" value="新增" click="add()" style="impBtn hMargin fLeft shadow" />
2 js(如果页面click方法为addcat 在下文件中加addcat方法)
路径:thinkphp/Examples/Public/Js/common.js
function add(id){
if (id)
{
location.href = URL+"/add/id/"+id;
}else{
location.href = URL+"/add/";
}
}
注:在此js中alert时 会延迟,所以开始跟踪不到此js是否被执行 需要删除public下的Runtime/~runtime.php 缓存文件 或者开启调试模式
3 js走进action中,如果action中没有此方法则直接找页面
thinkphp/Examples/Rbac/Lib/Action/CommonAction.class.php
public function add() {
$this->display();
}