/** * Static creator method * * This is cabable of creating derivered classes too: * <code php> * Control::Make('div')->content('Doh!'); * TextInput::Make()->css('width','300px'); * </code> * @param string $tag HTML tag name (like div, span, a, img,...) * @return Control The created control */ public static function Make($tag = false) { $className = get_called_class(); $res = new $className('Make is calling so skip __initialize call'); $args = func_get_args(); system_call_user_func_array_byref($res, '__initialize', $args); return $res; }
/** * The one and only constructor for all subclasses. * * These must not implement a constructor but the __initialize method. */ function __construct() { if (!hook_already_fired(HOOK_PRE_RENDER)) { register_hook(HOOK_PRE_RENDER, $this, "PreRender"); } elseif (!hook_already_fired(HOOK_POST_EXECUTE)) { register_hook(HOOK_POST_EXECUTE, $this, "PreRender"); } if (!unserializer_active()) { $args = func_get_args(); system_call_user_func_array_byref($this, '__initialize', $args); } }
/** * @override */ function WdfRender() { if ($this->DataCallback) { $this->Clear(); $args = array($this); system_call_user_func_array_byref($this->DataCallback[0], $this->DataCallback[1], $args); } if ($this->ItemsPerPage && !$this->HidePager) { $pager = $this->RenderPager(); $this->content($pager); } if ($this->footer) { $this->prepend($this->footer); } //array_merge(array($this->footer),$this->_content); if ($this->header) { $this->prepend($this->header); } //array_merge(array($this->header),$this->_content); if ($this->colgroup) { $this->prepend($this->colgroup); } //array_merge(array($this->colgroup),$this->_content); if ($this->Caption) { $this->_ensureCaptionObject(); $this->prepend($this->Caption); //array_merge(array($this->Caption),$this->_content); } foreach ($this->_content as &$c) { if (!is_object($c) || get_class_simple($c) != "TBody") { continue; } foreach ($c->_content as $r) { if (!$r instanceof Tr) { continue; } $rcnt = count($r->_content); for ($i = 0; $i < $rcnt; $i++) { if ($r->_content[$i]->CellFormat) { $r->_content[$i]->CellFormat->Format($r->_content[$i], $this->Culture); } elseif (isset($this->ColFormats[$i])) { $this->ColFormats[$i]->Format($r->_content[$i], $this->Culture); } } } } return parent::WdfRender(); }