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


PHP Control::primary方法代码示例

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


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

示例1: __construct

 function __construct()
 {
     if (!$control) {
         $control = Control::primary();
     }
     $this->control = $control;
     $this->lt = $control->lt;
     $this->db = $this->control->db;
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:9,代码来源:CrudModel.php

示例2: __construct

 function __construct($control = null)
 {
     if (!$control) {
         $control = Control::primary();
     }
     $this->control = $control;
     $this->protocol = $_ENV['protocol'] ? $_ENV['protocol'] : 'http';
     $this->baseUrl = $this->protocol . '://' . $_ENV['httpHost'] . '/';
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:9,代码来源:View.php

示例3: page

 static function page($sql, $pageNumber = null, $pageBy = 50, $max = null)
 {
     $pageBy = $pageBy ? $pageBy : 50;
     if ($pageNumber === null) {
         $control = \Control::primary();
         $pageNumber = (int) $control->in['_page'] - 1;
     }
     $pageNumber = $pageNumber > 0 ? $pageNumber : 0;
     $offset = $pageBy * $pageNumber;
     $sql .= "\nLIMIT " . $offset . ', ' . $pageBy;
     list($count, $rows) = \Db::countAndRows($max ? $max + 1 : null, $sql);
     $top = $count;
     if ($max && $count > $max) {
         $top = $max;
     }
     $pages = ceil($top / $pageBy);
     self::$lastPaging = array('rows' => $rows, 'info' => array('count' => $count, 'pages' => $pages, 'top' => $top, 'page' => $pageNumber + 1));
     return self::$lastPaging;
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:19,代码来源:SortPage.php

示例4: __construct

 function __construct($data = null, $options = null)
 {
     $this->control = \Control::primary();
     $this->in = $this->control->in;
     ///an array of keys to values used in conjuction with TO_ARRAY to serve as override values for form fields
     if (!is_array($data)) {
         if ($this->in) {
             $this->data = $this->in;
         } else {
             $this->data = $this->control->item;
         }
     } else {
         $this->data = $data;
     }
     ///the the of behavior for determining what the actual value of a form field should be
     $this->valueBehavior = $options['valueBehavior'] ? $options['valueBehavior'] : 'to_input';
     ///attribute parsers to apply when handling options on form method
     $this->additionalParsers = $options['additionalParsers'];
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:19,代码来源:Form.php

示例5: __construct

 function __construct($control = null)
 {
     $this->control = $control ? $control : Control::primary();
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:4,代码来源:Crud.php


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