示例#1
0
 public function del()
 {
     $id = I('id', NULL);
     if (!empty($id)) {
         $article = new HelpModel();
         if (is_array($id)) {
             $where = ' id in (' . implode(',', $id) . ')';
         } else {
             $where = 'id = ' . $id;
         }
         if (false !== $article->where($where)->delete()) {
             $this->message('删除成功', __URL__ . '/index');
         } else {
             $this->message('删除失败:' . $article->getError(), __URL__ . '/index');
         }
     } else {
         $this->message('请选择删除对象', __URL__ . '/index');
     }
 }
示例#2
0
 public function help()
 {
     $id = I('id', NULL);
     if (empty($id)) {
         $this->message2('未指定常见问题!', 'index');
     }
     $model = new HelpModel();
     $help = $model->where('id=' . $id)->find();
     if ($help['keyword'] != '') {
         $this->assign('seo_keyword', $help['keyword']);
     }
     if ($help['desc'] != '') {
         $this->assign('seo_desc', $help['desc']);
     }
     $config = M('config')->where('id=1')->find();
     $this->assign('seo_title', $help['title'] . '-' . $config['sitename']);
     $this->assign('help', $help);
     $this->display();
 }
 function startup()
 {
     parent::startup();
     $this->helpsModel = HelpModel::init();
 }
示例#4
0
 function __construct(IComponentContainer $parent = NULL, $name = NULL)
 {
     parent::__construct($parent, $name);
     $this->helpModel = HelpModel::init();
 }
示例#5
0
 public function other($arg = false)
 {
     require 'models/helpModel.php';
     $model = new HelpModel();
     $this->view->blah = $model->blah();
 }