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


PHP Component::count方法代码示例

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


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

示例1: index

 public function index($offset = 0)
 {
     $this->filter_access('Component', 'roled_select', base_url());
     $component = new Component();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "comp_name";
             break;
         case "2":
             $data['col'] = "comp_type";
             break;
         case "3":
             $data['col'] = "comp_id";
             break;
         default:
             $data['col'] = "comp_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['title'] = "Component";
     $data['btn_add'] = anchor('components/add', 'Add New', array("class" => "btn btn-primary"));
     $data['btn_home'] = anchor(base_url(), 'Home');
     $uri_segment = 3;
     $offset = $this->uri->segment($uri_segment);
     if ($this->input->get('search_by')) {
         $total_rows = $component->like($_GET['search_by'], $_GET['q'])->count();
         $component->like($_GET['search_by'], $_GET['q'])->order_by($data['col'], $data['dir']);
     } else {
         $total_rows = $component->count();
         $component->order_by($data['col'], $data['dir']);
     }
     $data['components'] = $component->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("components/index");
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->view('components/index', $data);
 }
开发者ID:anggadjava,项目名称:payroll,代码行数:43,代码来源:components.php

示例2: testCount

 function testCount()
 {
     $comp = new Component('VCALENDAR');
     $this->assertEquals(1, $comp->count());
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:5,代码来源:ComponentTest.php


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