本文整理汇总了PHP中TWebControl::getAttributesToRender方法的典型用法代码示例。如果您正苦于以下问题:PHP TWebControl::getAttributesToRender方法的具体用法?PHP TWebControl::getAttributesToRender怎么用?PHP TWebControl::getAttributesToRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWebControl
的用法示例。
在下文中一共展示了TWebControl::getAttributesToRender方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttributesToRender
/**
* Returns the attributes to be rendered.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
unset($attributes['id']);
return $attributes;
}
示例2: getAttributesToRender
/**
* This overrides the parent implementation by rendering more THyperLink-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attr = parent::getAttributesToRender();
$href = $this->getNavigateUrl();
if (strlen($href) && $this->isEnabled()) {
$attr['href'] = pradoEncodeData($href);
}
$target = $this->getTarget();
if (strlen($target)) {
$attr['target'] = $target;
}
return $attr;
}
示例3: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TLinkButton-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attr = parent::getAttributesToRender();
if ($this->isEnabled()) {
$page = $this->getPage();
$postBack = $page->getPostBackClientEvent($this, '');
if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
$script = "Prado.Validation.AddTarget('{$this->ClientID}');";
$this->Page->registerEndScript($this->ClientID . 'target', $script);
}
$attr['href'] = "javascript:{$postBack}";
}
return $attr;
}
示例4: getAttributesToRender
/**
* Returns the attributes to be rendered.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$url = $this->getBackImageUrl();
if (strlen($url)) {
$this->setStyle(array('background-image' => "url({$url})"));
}
$attributes = parent::getAttributesToRender();
if (($cellSpacing = $this->getCellSpacing()) >= 0) {
$attributes['cellspacing'] = $cellSpacing;
} else {
$attributes['cellspacing'] = '0';
}
if (($cellPadding = $this->getCellPadding()) >= 0) {
$attributes['cellpadding'] = $cellPadding;
} else {
$attributes['cellpadding'] = '0';
}
$grid = $this->getGridLines();
if ($grid != 'None') {
if ($grid == 'Horizontal') {
$attributes['rules'] = 'rows';
} else {
if ($grid == 'Both') {
$attributes['rules'] = 'all';
} else {
if ($grid == 'Vertical') {
$attributes['rules'] = 'cols';
}
}
}
if (!isset($attributes['border'])) {
$attributes['border'] = '1';
}
}
$align = $this->getHorizontalAlign();
if ($align != 'NotSet') {
$attributes['align'] = $align;
}
return $attributes;
}
示例5: getAttributesToRender
/**
* Returns the attributes to be rendered.
* This method overrides the parent's implementation.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes['name'] = $this->getUniqueID();
if ($this->isReadOnly()) {
$attributes['readonly'] = 'readonly';
}
if ($this->isAutoPostBack()) {
$page = $this->getPage();
$script = $page->getPostBackClientEvent($this, '');
$attributes['onchange'] = "javascript:{$script}";
}
$type = $this->getTextMode();
if ($type === 'MultiLine') {
if (($rows = $this->getRows()) > 0) {
$attributes['rows'] = $rows;
}
if (($cols = $this->getColumns()) > 0) {
$attributes['cols'] = $cols;
}
if (!$this->isWrap()) {
$attributes['wrap'] = 'off';
}
} else {
$attributes['type'] = $type === 'Password' ? 'password' : 'text';
if (($cols = $this->getColumns()) > 0) {
$attributes['size'] = $cols;
}
if (($maxLength = $this->getMaxLength()) > 0) {
$attributes['maxlength'] = $maxLength;
}
$attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
}
return $attributes;
}
示例6: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TWebControl-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
if ($this->getGenerateCss()) {
unset($attributes['style']);
}
if (!$this->isEnabled()) {
$attributes['disabled'] = "disabled";
}
$tabIndex = $this->getTabIndex();
if (!empty($tabIndex)) {
$attributes['tabindex'] = $tabIndex;
}
$toolTip = $this->getToolTip();
if (strlen($toolTip)) {
$attributes['title'] = $toolTip;
}
$accessKey = $this->getAccessKey();
if (strlen($accessKey)) {
$attributes['accesskey'] = $accessKey;
}
$cssClass = $this->getCssClass();
if (strlen($cssClass)) {
$attributes['class'] = $cssClass;
}
return $attributes;
}
示例7: getAttributesToRender
/**
* Returns the attributes to be rendered.
* This method overrides the parent's implementation.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes["id"] = $this->getClientID();
$attributes["type"] = "checkbox";
$attributes["name"] = $this->getClientID();
if ($this->isChecked()) {
$attributes["checked"] = "checked";
}
if (!$this->isEnabled()) {
$attributes["disabled"] = "disabled";
}
if ($this->isAutoPostBack()) {
$page = $this->getPage();
$script = $page->getPostBackClientEvent($this, '');
$attributes["onclick"] = "javascript:{$script}";
}
$accessKey = $this->getAccessKey();
if (strlen($accessKey)) {
$attributes["acesskey"] = $accessKey;
}
$tabIndex = $this->getTabIndex();
if (!empty($tabIndex)) {
$attributes["tabindex"] = $tabIndex;
}
return $attributes;
}
示例8: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TImage-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes['src'] = $this->getImageUrl();
$attributes['border'] = $this->getBorder();
$attributes['alt'] = $this->isEncodeText() ? pradoEncodeData($this->getAlternateText()) : $this->getAlternateText();
$align = $this->getImageAlign();
if (strlen($align)) {
$attributes['align'] = $align;
}
return $attributes;
}
示例9: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TButton-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes['type'] = "submit";
$attributes['name'] = $this->getUniqueID();
$attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
$script = "Prado.Validation.AddTarget('{$this->ClientID}');";
$this->Page->registerEndScript($this->ClientID . 'target', $script);
}
return $attributes;
}
示例10: getAttributesToRender
/**
* This overrides the parent implementation by rendering the FOR
* attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attr = parent::getAttributesToRender();
$forID = $this->getForID();
$parent = $this->getParent();
$for = $parent->findObject($forID);
if (is_null($for)) {
throw new Exception("Invalid \"For\" attribute in TFormLabel value: {$forID}.");
} else {
if ($for instanceof TListControl) {
if (isset($attr['onclick'])) {
$onclick = explode(';', $attr['onclick']);
}
$onclick[] = 'document.getElementById(\'' . $for->getClientID() . '\').focus();return false;';
$attr['onclick'] = implode(';', $onclick);
}
$attr['for'] = $for->getClientID();
}
return $attr;
}
示例11: getAttributesToRender
/**
* Returns the attributes to be rendered.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$align = $this->getHorizontalAlign();
if ($align != 'NotSet') {
$attributes['align'] = strtolower($align);
}
$valign = $this->getVerticalAlign();
if ($valign != 'NotSet') {
$attributes['valign'] = strtolower($valign);
}
unset($attributes['id']);
return $attributes;
}
示例12: getAttributesToRender
/**
* Returns the attributes to be rendered.
* @return ArrayObject attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
if (($colspan = $this->getColumnSpan()) > 0) {
$attributes['colspan'] = $colspan;
}
if (($rowspan = $this->getRowSpan()) > 0) {
$attributes['rowspan'] = $rowspan;
}
if (!$this->isWrap()) {
$attributes['nowrap'] = 'nowrap';
}
$align = $this->getHorizontalAlign();
if ($align != 'NotSet') {
$attributes['align'] = strtolower($align);
}
$valign = $this->getVerticalAlign();
if ($valign != 'NotSet') {
$attributes['valign'] = strtolower($valign);
}
unset($attributes['id']);
return $attributes;
}
示例13: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TPanel-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$url = $this->getBackImageUrl();
if (strlen($url)) {
$this->setStyle(array('background-image' => "url({$url})"));
}
$attributes = parent::getAttributesToRender();
$align = $this->getHorizontalAlign();
if (strlen($align)) {
$attributes['align'] = $align;
}
if (!$this->isWrap()) {
$attributes['nowrap'] = 'nowrap';
}
return $attributes;
}
示例14: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TButton-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes['type'] = 'file';
$attributes['name'] = $this->getUniqueID();
return $attributes;
}
示例15: getAttributesToRender
/**
* This overrides the parent implementation by rendering more TButton-specific attributes.
* @return ArrayObject the attributes to be rendered
*/
protected function getAttributesToRender()
{
$attributes = parent::getAttributesToRender();
$attributes['type'] = 'file';
$attributes['name'] = $this->getUniqueID();
if (($cols = $this->getColumns()) > 0) {
$attributes['size'] = $cols;
}
return $attributes;
}