• ThinkPHP 分页类的使用及退出功能的实现


    /* ThinkPHP设置编码统一:
    一、数据库设置为utf8_bin
    二、HTML页面设置charset=utf-8,而且检查文档编码格式是否是utf-8。phpDesigner8设置方式为“文件-》文件编码-》选中UTF-8
    */


    <?php /** 这是后台index控制器 */ Class IndexAction extends CommonAction{ public function index(){ $this->display(); } Public function logout(){//退出功能 session_unset(); session_destroy(); $this->redirect('Admin/Login/index'); } Public function all(){ import('ORG.Util.Page');//载入分页类 $count = M('user')->count();//计算表中数据条数 $page = new Page($count,4); //实例化分页类,并传参,每页4条数据 $limit =$page->firstRow.','.$page->listRows; $wish =M('user')->order('time DESC')->limit($limit)->select(); $this->wish = $wish; $this->page = $page->show();//模板中使用{$page}显示分页条 echo "all方法内容"; $this->display(); } Public function delete(){ $id = I('id'); if( M('user')->where(array('id' => $id))->delete()){ $this->success('删除成功',U('Admin/Index/all')); }else{ $this->error('删除失败'); } } }
  • 相关阅读:
    hive 数据类型
    Hive与Hbase结合使用
    Impala介绍
    ZooKeeper管理员指南——部署与管理ZooKeeper
    hbase exporter importer 导出 导入
    Ganglia 安装 for centos6.5
    EPEL for CentOS or Redhat
    hbase->Mapreduce->hbase
    Hadoop YARN配置参数剖析(3)—MapReduce相关参数
    hadoop job 重要性能参数
  • 原文地址:https://www.cnblogs.com/xtmp/p/5015491.html
Copyright © 2020-2023  润新知