/** * @wiki /MVC模式/视图/表单视图 * * view视图分为两种,一种视图,显示模板内容。还有一种就是表单视图(formview),可以动态的进行数据的交互。 * ==Bean配置数组== * {| * !属性 * !类型 * !默认值 * !可选 * !说明 * |-- -- * |hideForm * |boolean * |false * |必须 * |是否默认隐藏表单(form标签部分) * |} */ public function buildBean(array &$arrConfig, $sNamespace = '*', \org\jecat\framework\bean\BeanFactory $aBeanFactory = null) { if (isset($arrConfig['hideForm'])) { $this->hideForm($arrConfig['hideForm'] ? true : false); } parent::buildBean($arrConfig, $sNamespace, $aBeanFactory); }
public function __construct($sName = null, UI $aUI = null) { if (!$sName) { $sName = 'webpage'; } parent::__construct($sName, 'org.jecat.framework:Webpage.template.html', false, $aUI); }
private function _displayAssemblyList(array &$arrAssemblyList, IOutputStream $aDevice, $sParentFrameLayout = null) { if (empty($arrAssemblyList['items'])) { return; } $aDevice->write($this->htmlWrapper($arrAssemblyList, $sParentFrameLayout)); $aDebugging = Application::singleton()->isDebugging(); foreach ($arrAssemblyList['items'] as &$arrAssemblyItem) { // 视图 if ($arrAssemblyItem['type'] === 'view') { if (empty($arrAssemblyItem['object'])) { if (empty($arrAssemblyItem['id'])) { throw new Exception("视图类型的装配内容,缺少视图注册ID"); } if (!($arrAssemblyItem['object'] = View::findRegisteredView($arrAssemblyItem['id']))) { //throw new Exception("在根据装配单输出视图时,无法根据提供的视图ID找到视图对像:%s,该视图可能不存在或未注册。",$arrAssemblyItem['id']) ; continue; } } $bEmptyView = $arrAssemblyItem['object']->template() ? false : true; if (!$bEmptyView) { $aDevice->write($this->htmlWrapper($arrAssemblyItem, $arrAssemblyList['layout'])); if ($aDebugging) { $aDevice->write("<!-- view name: " . $arrAssemblyItem['object']->name() . " -->\r\n"); } } $arrAssemblyItem['object']->render($aDevice); if (!$bEmptyView) { $aDevice->write("</div>\r\n"); } } else { if ($arrAssemblyItem['type'] === 'frame') { $this->_displayAssemblyList($arrAssemblyItem, $aDevice, $arrAssemblyList['layout']); } else { throw new Exception("无效的装配内容类型:%s", $arrAssemblyItem['type']); } } } $aDevice->write("<div class='jc-layout-item-end'></div></div>\r\n"); }
public function onModelChanging(View $aView) { if ($aModel = $aView->model() and $aModel instanceof IPaginal) { $this->setPaginal($aModel); } }