koala-framework / kwc-policy
此软件包最新版本(1.0.x-dev)没有提供许可证信息。
                    
                    包含多个组件的策略包,简化策略链接或通知
    1.0.x-dev
    2018-09-07 07:24 UTC
Requires
This package is auto-updated.
Last update: 2024-09-12 07:37:18 UTC
README
通知框
提供可以用于向网站用户显示更改的弹出窗口。用户关闭窗口或30天后消失。
必须作为一个框包含并使其可编辑
$ret['generators']['notificationBox'] = array(
    'class' => 'Kwf_Component_Generator_Box_Static',
    'component' => 'KwcPolicy_Kwc_NotificationBox_Component',
    'inherit' => true,
    'unique' => true,
);
$ret['editComponents'][] = 'notificationBox';
政策文本
提供可以用于分配带有链接到政策页面的集中文本的组件。
必须包含在根组件(没有框!)中并使其可编辑
$ret['generators']['policyText'] = array(
    'class' => 'Kwf_Component_Generator_Static',
    'component' => 'KwcPolicy_Kwc_PolicyText_Component',
);
$ret['editComponents'][] = 'policyText';
- 在非前端表单组件中的使用:在getTemplateVars()中仅调用以下内容$ret['policyText'] = KwcPolicy_Kwc_PolicyText_Component::getPolicyText($this->getData(), $renderer);
- 在前端表单组件的字段中的使用- 当定义前端表单时,将应显示文本的字段添加到常规位置,但留空文本$this->add(new Kwf_Form_Field_Checkbox('terms_and_conditions')) ->setAllowBlank(false) ->setHideLabel(true);
- 在调用父类之前的getTemplateVars()中必须设置文本$policyText = KwcPolicy_Kwc_PolicyText_Component::getPolicyText($this->getData(), $renderer); $this->getForm()->fields->getByName('terms_and_conditions') ->setBoxLabel($policyText);
 
- 当定义前端表单时,将应显示文本的字段添加到常规位置,但留空文本