本文整理汇总了PHP中Frame_Decorator::get_containing_block方法的典型用法代码示例。如果您正苦于以下问题:PHP Frame_Decorator::get_containing_block方法的具体用法?PHP Frame_Decorator::get_containing_block怎么用?PHP Frame_Decorator::get_containing_block使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame_Decorator
的用法示例。
在下文中一共展示了Frame_Decorator::get_containing_block方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render_border
protected function _render_border(Frame_Decorator $frame, $corner_style = "bevel")
{
$cb = $frame->get_containing_block();
$style = $frame->get_style();
$bbox = $frame->get_border_box();
$bp = $frame->get_style()->get_border_properties();
$widths = array($style->length_in_pt($bp["top"]["width"]), $style->length_in_pt($bp["right"]["width"]), $style->length_in_pt($bp["bottom"]["width"]), $style->length_in_pt($bp["left"]["width"]));
foreach ($bp as $side => $props) {
list($x, $y, $w, $h) = $bbox;
if (!$props["style"] || $props["style"] == "none" || $props["width"] <= 0) {
continue;
}
switch ($side) {
case "top":
$length = $w;
break;
case "bottom":
$length = $w;
$y += $h;
break;
case "left":
$length = $h;
break;
case "right":
$length = $h;
$x += $w;
break;
default:
break;
}
$method = "_border_" . $props["style"];
$this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
}
}