當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。