当前位置: 首页>>代码示例>>PHP>>正文


PHP FormElement::renderAttributes方法代码示例

本文整理汇总了PHP中FormElement::renderAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::renderAttributes方法的具体用法?PHP FormElement::renderAttributes怎么用?PHP FormElement::renderAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormElement的用法示例。


在下文中一共展示了FormElement::renderAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderAttributes

  public function renderAttributes()
  {
    $this->_processAttributes();

    if (!$this->path)
    {
      $action_path = $_SERVER['PHP_SELF'];

      if($node_id = Limb :: toolkit()->getRequest()->get('node_id'))
        $action_path .= '?node_id=' . $node_id;
    }
    else
      $action_path = $this->path;

    if (strpos($action_path, '?') === false)
      $action_path .= '?';
    else
      $action_path .= '&';

    if($this->action)
      $action_path .= 'action=' . $this->action;

    if ((bool)$this->reload_parent)
    {
      $action_path .= '&reload_parent=1';
    }

    $this->attributes['onclick'] = $this->onclick;
    $this->attributes['onclick'] .= "submitForm(this.form, '{$action_path}')";

    parent :: renderAttributes();

    unset($this->attributes['onclick']);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:GridButtonComponent.class.php

示例2: renderAttributes

  /**
  * Overrides then calls with the parent render_attributes() method. Makes
  * sure there is always a value attribute, even if it's empty.
  * Called from within a compiled template render function.
  */
  public function renderAttributes()
  {
    $value = $this->getValue();

    if (!is_null($value))
    {
      $this->attributes['value'] = $value;
    }

    parent :: renderAttributes();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:16,代码来源:InputFormElement.class.php

示例3: renderAttributes

  /**
  * Overrides then calls with the parent render_attributes() method dealing
  * with the special case of the checked attribute
  */
  public function renderAttributes()
  {
    $value = $this->getValue();

    if ($value)
      $this->attributes['checked'] = 1;
    else
    unset($this->attributes['checked']);

    parent :: renderAttributes();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:15,代码来源:InputCheckboxComponent.class.php

示例4: renderAttributes

  /**
  * Overrides then calls with the parent render_attributes() method dealing
  * with the special case of the checked attribute
  */
  public function renderAttributes()
  {
    $value = $this->getValue();

    if (isset($this->attributes['value']) &&  $value == $this->attributes['value'])
    {
      $this->attributes['checked'] = 1;
    }
    else
    {
      unset($this->attributes['checked']);
    }
    parent::renderAttributes();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:18,代码来源:InputRadioComponent.class.php

示例5: renderAttributes

  public function renderAttributes()
  {
    if (!isset($this->attributes['path']) ||  !$this->attributes['path'])
    {
      $action_path = $_SERVER['PHP_SELF'];

      $request = Limb :: toolkit()->getRequest();

      if($node_id = $request->get('node_id'))
        $action_path .= '?node_id=' . $node_id;
    }
    else
      $action_path = $this->attributes['path'];

    if (strpos($action_path, '?') === false)
      $action_path .= '?';
    else
      $action_path .= '&';

    if(isset($this->attributes['action']))
      $action_path .= 'action=' . $this->attributes['action'];

    if (isset($this->attributes['reload_parent']) &&  $this->attributes['reload_parent'])
    {
      $action_path .= '&reload_parent=1';
      unset($this->attributes['reload_parent']);
    }

    if(!isset($this->attributes['onclick']))
      $this->attributes['onclick'] = '';

    $this->attributes['onclick'] .= "submitForm(this.form, '{$action_path}')";

    unset($this->attributes['path']);
    unset($this->attributes['action']);

    parent :: renderAttributes();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:38,代码来源:ControlButtonComponent.class.php


注:本文中的FormElement::renderAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。