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 ...
随机推荐
- java学习笔记--java中的基本数组[5]
java基础很重要, 今天呆家看java视频,顺便总结前几周看的java书籍,做一下简单的总结:1:数组的声明,2:数组的赋值: 3:数组的方法: 声明一个数组主要有两种方式: //类型 []数组名字 ...
- 12 抽象函数-abstract
只有函数的定义,没有函数体的函数被称为抽象函数 1.抽象函数就是没有函数体的函数 2.抽象类使用abstract来定义 3.抽象类不能生产对象,但是可以拥有构造函数 abstract void fun ...
- 匿名内部类为什么访问外部类局部变量必须是final的?
1.内部类里面使用外部类的局部变量时,其实就是内部类的对象在使用它,内部类对象生命周期中都可能调用它,而内部类试图访问外部方法中的局部变量时,外部方法的局部变量很可能已经不存在了,那么就得延续其生命, ...
- 兼容性问题
直接在html文档中使用 来表示空格,在不同浏览器中的占位大小是不一样的. 因为不同浏览器默认的字体是不一样的,不同字体下的空格表示 占位大小不一致. 我们对 指定使用同样的字体就能让 显示同样的占位 ...
- SQL Server 自增字段重置
--- 删除原表数据,并重置自增列 truncate table tablename --truncate方式也可以重置自增字段 --重置表的自增字段,保留数据 DBCC CHECKIDENT (ta ...
- Leetcode 368. Largest Divisible Subset
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of ...
- 【BZOJ-1391】order 最小割 + 最大全闭合图
1391: [Ceoi2008]order Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 1334 Solved: 405[Submit][Statu ...
- 【BZOJ-1911】特别行动队 DP + 斜率优化
1911: [Apio2010]特别行动队 Time Limit: 4 Sec Memory Limit: 64 MBSubmit: 3478 Solved: 1586[Submit][Statu ...
- lua的corroutine学习
lua的corroutine学习 function receive (prod) local status, value = coroutine.resume(prod) return value e ...
- 记一次rsync增量同步远程服务器文件
rsync remote shell 增量方式同步数据 rsync同步文件有两种方式,一种是daemon的方式(rsync daemon)另一种方式是通过远程shell方式(rsync remote ...