yourphp的edit,updata,dele
参考文件Yourphp\Lib\Action\User\PostAction.class.php
public function add()
{
$form=new Form();
$form->isadmin=;
$form->doThumb = $this->Role[$this->_groupid]['allowattachment'] ? : ;
$form->doAttach = $this->Role[$this->_groupid]['allowattachment'] ? : ;;
$this->assign ( 'form', $form );
$module = $this->module[$this->moduleid]['name'];
$template = file_exists(TMPL_PATH.'User/'.$this->sysConfig['DEFAULT_THEME'].'/'.$module.'_edit.html') ? $module.':edit' : 'Post:edit';
$this->display ( $template);
} public function edit()
{
if(!$this->_userid){
$this->error(L('nologin'));
}
$id = intval($_REQUEST ['id']);
$vo = $this->dao->getById ( $id );
$form=new Form($vo);
$form->isadmin=;
$form->doAttach= $this->Role[$this->_groupid]['allowattachment'] ? : ;;
$form->doThumb = $this->Role[$this->_groupid]['allowattachment'] ? : ;
$this->assign ( 'vo', $vo );
$this->assign ( 'form', $form );
$module = $this->module[$this->moduleid]['name'];
$template = file_exists(TMPL_PATH.'User/'.$this->sysConfig['DEFAULT_THEME'].'/'.$module.'_edit.html') ? $module.':edit' : 'Post:edit';
$this->display ( $template);
} /**
* 录入
*
*/
public function insert()
{
if($this->moduleid!= && !in_array($this->_groupid,explode(',',$this->categorys[$_POST['catid']]['postgroup']))) $this->error (L('add_no_postgroup'));
$c=A('Admin/Content');
$_POST['ip'] = get_client_ip();
$userid = $this->_userid;
$username = $this->_username ? $this->_username : get_safe_replace($_POST['username']);
$c->insert($this->module[$this->moduleid]['name'],$this->fields,$userid, $username,$this->_groupid);
} function update()
{
if(!$this->_userid){
$this->error(L('nologin'));
}
if($this->moduleid!= && !in_array($this->_groupid,explode(',',$this->categorys[$_POST['catid']]['postgroup']))) $this->error (L('add_no_postgroup')); $c=A('Admin/Content');
$c->update($this->module[$this->moduleid]['name'],$this->fields);
}
$date['beizhu']= $_POST['beizhu'];
$r = $m->where('id='.$id)->save($date);
yourphp的edit,updata,dele的更多相关文章
- yourphp基本语句
实例化页面代码 1.时间代码:{$vo.createtime|toDate=###,'Y-m-d H:i:s'} 2.连接:{:U('Pro/arr')},{:URL()} 如:<form ac ...
- PhpStorm和WAMP配置调试参数,问题描述Error. Interpreter is not specified or invalid. Press “Fix” to edit your project configuration.
PhpStorm和WAMP配置调试参数 问题描述: Error. Interpreter is not specified or invalid. Press “Fix” to edit your p ...
- eclipse调试(debug)的时候,出现Source not found,Edit Source Lookup Path,一闪而过
问题描述 使用Eclipse调试代码的时候,打了断点,经常出现Source not found,网上找了半天,大部分提示点击Edit Source Lookup Path,添加被调试的工程,然而往往没 ...
- [LeetCode] One Edit Distance 一个编辑距离
Given two strings S and T, determine if they are both one edit distance apart. 这道题是之前那道Edit Distance ...
- [LeetCode] Edit Distance 编辑距离
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2 ...
- ASP.NET MVC 5 - 验证编辑方法(Edit method)和编辑视图(Edit view)
在本节中,您将验证电影控制器生成的编辑方法(Edit action methods)和视图.但是首先将修改点代码,使得发布日期属性(ReleaseDate)看上去更好.打开Models \ Movie ...
- [调整] Firemonkey iOS 原生 Edit 透明框, 改变框色
说明:iOS 原生 Edit 透明框 适用:Berlin Firemonkey 方法:在 StyleLookup 输入 transparentedit 效果: 如果有图片 Image 在这二个 Edi ...
- Edit Distance
Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert ...
- 编辑距离——Edit Distance
编辑距离 在计算机科学中,编辑距离是一种量化两个字符串差异程度的方法,也就是计算从一个字符串转换成另外一个字符串所需要的最少操作步骤.不同的编辑距离中定义了不同操作的集合.比较常用的莱温斯坦距离(Le ...
随机推荐
- Linux_rsylogd日志
Linux_日志管理介绍(一)http://www.cnblogs.com/gossip/p/5972663.html Linux_rsyslogd日志服务(二)http://www.cnblogs. ...
- react.js 之 批量添加与删除功能
最近做的CMS需要用到批量添加图片的功能:在添加文件的容器盒子内,有两个内容,分别是:添加按钮与被添加的选择文件组件. 结构分析: 被添加的组件,我们称为:UploadQiNiuFiles(七牛文件上 ...
- Maven 库
mvnrepository https://mvnrepository.com/ 最方便查询的库 <repositories> <repository> <id&g ...
- Activiti 学习笔记(2016-8-30)
前言 不管学习什么,都必须对知识体系中专有的名词或者特定的语言组织方式 有所了解. 本文仅记录学习过程中的笔记,参考意义因人而定,不保证所言全部正确. 学习方式,百度传课的视频<权威Activi ...
- spring-ant-处理zip
因为java类型自带的不支持中文路径,不过两者使用的方式是一样的,只是apache压缩工具多了设置编码方式的接口,其他基本上是一样的.另外,如果使用org.apache.tools.zip.ZipOu ...
- 设置CentOS6.5时钟同步
一.测试ntp服务 # rpm -q ntp ntp-4.2.4p8-2.el6.x86_64 // 这表示已安装了,如果没有安装,这是空白. 二./etc/ntp.conf 红色部分是修改的. 配置 ...
- 前端打包/自动化构建工具:fis3
据说这个可以进行打包,并且可以实现类似/script/test-adsf123.js或者/script/test.js?v=asdf123 先做个记号 参考:http://fis.baidu.com/
- [NOIP2014] 提高组 洛谷P1351 联合权值
题目描述 无向连通图G 有n 个点,n - 1 条边.点从1 到n 依次编号,编号为 i 的点的权值为W i ,每条边的长度均为1 .图上两点( u , v ) 的距离定义为u 点到v 点的最短距离. ...
- win7下firefox浏览器不能使用
win7下firefox浏览器不能使用,只有360浏览器才能使用. 使用360安全卫士,到更多工具里面选择"LSP修复",就可以了. 原来是因为安装了土豆加速,然后卸载导致的. 看 ...
- POJ1025 Department
POJ1025 是一道模拟题. 这题第一个障碍是现在少见的循环电梯 ('pater-noster' elevator) ”The building has `pater-noster' elevato ...