时间:2016-02-24 18:40 来源: 我爱IT技术网 作者:佚名
欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【Zend Framework留言本模型文件 (PHP源码)】,下面是详细的分享!
Zend Framework留言本模型文件 (PHP源码)
<?php
class Guestbook extends Zend_Db_Table {
protected $_name='gb_content';
function save($info)
{
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter=new Zend_Filter_StripTags();
$username=trim($filter->filter($info['username']));
$content=trim($filter->filter($info['content']));
$id=intval($filter->filter($info['id']));
if ($username && $content) {
$data=array(
'username'=> $username,
'content'=> $content,
'insert_time'=> date('Y-m-d'),
);
if ($id) {
unset($data['insert_time']);
$this->update($data,'id='.$id);
} else {
$this->insert($data);
}
return ;
}
}
function deleteItem($id)
{
$id=intval($id);
$this->delete('id='.$id);
}
}
?>
class Guestbook extends Zend_Db_Table {
protected $_name='gb_content';
function save($info)
{
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter=new Zend_Filter_StripTags();
$username=trim($filter->filter($info['username']));
$content=trim($filter->filter($info['content']));
$id=intval($filter->filter($info['id']));
if ($username && $content) {
$data=array(
'username'=> $username,
'content'=> $content,
'insert_time'=> date('Y-m-d'),
);
if ($id) {
unset($data['insert_time']);
$this->update($data,'id='.$id);
} else {
$this->insert($data);
}
return ;
}
}
function deleteItem($id)
{
$id=intval($id);
$this->delete('id='.$id);
}
}
?>
以上所分享的是关于Zend Framework留言本模型文件 (PHP源码),下面是编辑为你推荐的有价值的用户互动:
相关问题:
答: >>详细
相关问题:
答: >>详细
相关问题:
答: >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
