当前位置: 首页>>代码示例>>PHP>>正文


PHP core::i方法代码示例

本文整理汇总了PHP中core::i方法的典型用法代码示例。如果您正苦于以下问题:PHP core::i方法的具体用法?PHP core::i怎么用?PHP core::i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core的用法示例。


在下文中一共展示了core::i方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete()
 {
     if ($this->get['id']) {
         $id = $this->get['id'];
         $rs = core::i('mdl_class')->delete($id);
         $this->msg($rs['status'], $rs['msg']);
     }
     $this->index();
 }
开发者ID:Junec,项目名称:admin,代码行数:9,代码来源:class.php

示例2: index

 public function index()
 {
     $parent = $this->get['parent'];
     core::i('lib_class')->getIds($parent, $parentIds);
     $parentData = $this->model['class']->getOne($parent);
     $sonClass = $this->model['class']->getList('*', array('parent' => $parent), 0, -1, 'ordernum ASC');
     $model = new mdl_content();
     foreach ($sonClass as $v) {
         $tag[] = array('title' => $v['title'], 'filter' => array('parent' => $v['id']));
     }
     $this->finder(array('title' => $parentData['title'], 'model' => $model, 'ischeckbox' => true, 'orderby' => 'id desc', 'pagenums' => 5, 'baseurl' => "index.php?ctl=content&act=index&parent={$parent}", 'basefilter' => array('parent' => $parentIds), 'button' => array(array('title' => '添加', 'href' => "#"), array('title' => '置顶', 'href' => "javascript:finder.submit('index.php?ctl=content&act=delete');"), array('title' => '推荐', 'href' => "javascript:finder.submit('index.php?ctl=content&act=delete');"), array('title' => '删除', 'href' => "javascript:finder.submit('index.php?ctl=content&act=delete');")), 'tag' => $tag));
 }
开发者ID:Junec,项目名称:admin,代码行数:12,代码来源:content.php

示例3: finder

 protected function finder($params = array())
 {
     $model = $params['model'];
     $pager = core::i('core_pager');
     #配置信息
     $finder = array();
     $finder['title'] = $params['title'];
     $finder['ischeckbox'] = $params['ischeckbox'];
     $finder['isdelete'] = $params['isdelete'];
     $finder['orderby'] = $params['orderby'];
     $finder['pagenums'] = $params['pagenums'];
     $finder['basefilter'] = $params['basefilter'];
     $finder['button'] = $params['button'];
     $finder['pkey'] = $model->pri;
     $finder['url'] = core::i('core_url')->getUrl();
     $finder['queryParams'] = core::i('core_url')->getQueryParams();
     $finder['model'] = get_class($params['model']);
     $finder['baseurl'] = $params['baseurl'];
     $finder['tag'] = $params['tag'];
     #finder搜索
     if ($this->post['dopost'] == 'finderSearch') {
         $searchPost = $this->post;
         unset($searchPost['dopost']);
         $searchfilter = array();
         if ($searchPost['finderse']) {
             if (isset($searchPost['finderse']['select']) && is_array($searchPost['finderse']['select'])) {
                 foreach ($searchPost['finderse']['select'] as $fsk => $fsv) {
                     $searchfilter['filter'][$fsk] = $fsv;
                 }
             }
             if (isset($searchPost['finderse']['input']) && $searchPost['finderse']['input-value'] != '') {
                 $searchfilter['filter'][$searchPost['finderse']['input']] = $searchPost['finderse']['input-value'];
             }
             $searchfilter['finderseiv'] = $searchPost['finderse']['input-value'];
         }
         $queryParams = array_merge($finder['queryParams'], $searchfilter);
         $redirectUrl = 'index.php?' . core::i('core_url')->parseQueryString($queryParams);
         header("HTTP/1.1 301 Moved Permanently");
         header("Location: {$redirectUrl}");
         exit;
     }
     #显示字段
     $finder['fields'] = array();
     $finder['search'] = array();
     $finder['totalFieldWidth'] = 0;
     $finder['fieldsinfo'][$model->pri] = '`' . $model->pri . '`';
     $extend = array();
     foreach ($model->finder as $k => $v) {
         $finder['fields'][$k] = array('title' => $v['title'], 'width' => $v['width'], 'sort' => $v['sort']);
         if ($v['type'] == '' || $v['type'] == 'normal') {
             #查询字段
             $finder['fieldsinfo'][$k] = '`' . $k . '`';
             #搜索字段
             if ($v['search'] != '') {
                 $finder['search'][$v['search']][$k]['title'] = $v['title'];
                 $finder['search'][$v['search']][$k]['value'] = $v['value'];
                 if ($v['search'] == 'input') {
                     $finder['search'][$v['search']][$k]['key'] = $k . '|like';
                 } else {
                     $finder['search'][$v['search']][$k]['key'] = $k;
                 }
             }
         }
         #扩展列
         if ($v['type'] == 'extend') {
             $extend[] = $k;
         }
         $finder['totalFieldWidth'] += $v['width'];
     }
     #排序相关
     $get = $this->get;
     $orderby = $get['orderby'];
     $orderbytype = $get['orderbytype'];
     unset($get['orderby'], $get['orderbytype']);
     $finder['orderbyQueryString'] = core::i('core_url')->parseQueryString($get);
     if ($orderby != '' && $orderbytype != '') {
         $finder['orderby'] = $orderby . ' ' . $orderbytype;
     }
     #Tag
     if (isset($finder['tag']) && is_array($finder['tag'])) {
         foreach ($finder['tag'] as $k => $v) {
             $tagFilter = array_merge($finder['basefilter'], $v['filter']);
             $finder['tag'][$k]['count'] = $model->count($tagFilter);
             $finder['tag'][$k]['url'] = $finder['baseurl'] . '&findertag=' . $k;
         }
     }
     #Filter
     $getfilter = $this->get['filter'];
     $finder['findertag'] = $_GET['findertag'];
     foreach ($getfilter as $k => $v) {
         if ($v == '') {
             unset($getfilter[$k]);
         }
     }
     if (!is_array($getfilter) || !$getfilter) {
         $getfilter = array();
     }
     $finder['filter'] = array_merge($finder['basefilter'], $getfilter);
     if ($finder['findertag'] != '') {
         if (isset($finder['tag']) && is_array($finder['tag'])) {
//.........这里部分代码省略.........
开发者ID:Junec,项目名称:admin,代码行数:101,代码来源:controller.php

示例4: __construct

 public function __construct()
 {
     $this->classModel = core::i('mdl_class');
     $this->contentModel = core::i('mdl_content');
 }
开发者ID:Junec,项目名称:admin,代码行数:5,代码来源:class.php

示例5: finder_modify_parent

 public function finder_modify_parent($row = '')
 {
     $class = core::i('mdl_class')->getOne($row);
     return $class['title'];
 }
开发者ID:Junec,项目名称:admin,代码行数:5,代码来源:content.php


注:本文中的core::i方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。