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 ...
随机推荐
- Mac 下,配置SVN
Mac 环境下 sv 服务器的配置 本文目录 • 一.创建代码仓库,用来存储客户端所上传的代码 • 二.配置svn的用户权限 • 三.使用svn客户端功能 在Windows环境中,我们一般使用Tort ...
- caffe使用
训练时, solver.prototxt中使用的是train_val.prototxt ./build/tools/caffe/train -solver ./models/bvlc_referenc ...
- java学习笔记--java中的基本数组[5]
java基础很重要, 今天呆家看java视频,顺便总结前几周看的java书籍,做一下简单的总结:1:数组的声明,2:数组的赋值: 3:数组的方法: 声明一个数组主要有两种方式: //类型 []数组名字 ...
- ArcGIS 帮助(10.2、10.2.1 和 10.2.2)收集
帮助首页 [Oracle基础] 快速浏览:Oracle 地理数据库 什么是 Oracle Spatial? 设置到 Oracle 的连接 存储在 Oracle 地理数据库中的系统表 结合企业级地理数据 ...
- jquery 双击修改某项值
双击修改某项值 $(function() { $('td.breakword').dblclick(function(){ $(this).addClass('input').html('<in ...
- dede使用方法----更换模板
刚开始接触dede的时候,自己一直在纠结怎么更换自己的模板啊.后面在秀站网上找到了一个比较好的更换模板的文字教程.下面就我自己做的进行写的笔记. 准备:一个你自己做好的静态版网站,我们假设它的名称是w ...
- Java实现本地 fileCopy
前言: Java中流是重要的内容,基础的文件读写与拷贝知识点是很多面试的考点.故通过本文进行简单测试总结. 2.图展示[文本IO/二进制IO](这是参考自网上的一张总结图,相当经典,方便对比记忆) 3 ...
- AngularJs学习之一使用自定义的过滤器
script: 参数item是由AngularJs提供的,是应当被过滤的对象集合.而showComplete是我们传入的参数. {{item.action}} 用ng-model创造一个名为showC ...
- pyhthon --递归,装饰器
递归: 递归的概念很简单,如果函数包含了对其自身的调用,该函数就是递归.拗口一点的定义是,如果一个新的调用能在相同过程中较早的调用结束之前开始,那么该过程就是递归. """ ...
- double截取小数点位数
(double)decimal.Round(decimal.Parse((planVoSt.TotalCompleteAmount / planVoSt.TotalUserCount).ToStrin ...