本文整理汇总了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"]);
}