當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Table_Frame_Decorator::normalise方法代碼示例

本文整理匯總了PHP中Table_Frame_Decorator::normalise方法的典型用法代碼示例。如果您正苦於以下問題:PHP Table_Frame_Decorator::normalise方法的具體用法?PHP Table_Frame_Decorator::normalise怎麽用?PHP Table_Frame_Decorator::normalise使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Table_Frame_Decorator的用法示例。


在下文中一共展示了Table_Frame_Decorator::normalise方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function get_min_max_width()
 {
     if (!is_null($this->_min_max_cache)) {
         return $this->_min_max_cache;
     }
     $style = $this->_frame->get_style();
     $this->_frame->normalise();
     // Add the cells to the cellmap (this will calcluate column widths as
     // frames are added)
     $this->_frame->get_cellmap()->add_frame($this->_frame);
     // Find the min/max width of the table and sort the columns into
     // absolute/percent/auto arrays
     $this->_state = array();
     $this->_state["min_width"] = 0;
     $this->_state["max_width"] = 0;
     $this->_state["percent_used"] = 0;
     $this->_state["absolute_used"] = 0;
     $this->_state["auto_min"] = 0;
     $this->_state["absolute"] = array();
     $this->_state["percent"] = array();
     $this->_state["auto"] = array();
     $columns =& $this->_frame->get_cellmap()->get_columns();
     foreach (array_keys($columns) as $i) {
         $this->_state["min_width"] += $columns[$i]["min-width"];
         $this->_state["max_width"] += $columns[$i]["max-width"];
         if ($columns[$i]["absolute"] > 0) {
             $this->_state["absolute"][] = $i;
             $this->_state["absolute_used"] += $columns[$i]["absolute"];
         } else {
             if ($columns[$i]["percent"] > 0) {
                 $this->_state["percent"][] = $i;
                 $this->_state["percent_used"] += $columns[$i]["percent"];
             } else {
                 $this->_state["auto"][] = $i;
                 $this->_state["auto_min"] += $columns[$i]["min-width"];
             }
         }
     }
     // Account for margins & padding
     $dims = array($style->border_left_width, $style->border_right_width, $style->padding_left, $style->padding_right, $style->margin_left, $style->margin_right);
     if ($style->border_collapse !== "collapse") {
         list($dims[]) = $style->border_spacing;
     }
     $delta = $style->length_in_pt($dims, $this->_frame->get_containing_block("w"));
     $this->_state["min_width"] += $delta;
     $this->_state["max_width"] += $delta;
     return $this->_min_max_cache = array($this->_state["min_width"], $this->_state["max_width"], "min" => $this->_state["min_width"], "max" => $this->_state["max_width"]);
 }
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:48,代碼來源:table_frame_reflower.cls.php


注:本文中的Table_Frame_Decorator::normalise方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。