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


PHP Form::attached方法代码示例

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


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

示例1: attached

	/**
	 * This method will be called when the component (or component's parent)
	 * becomes attached to a monitored object. Do not call this method yourself.
	 * @param  Nette\ComponentModel\IComponent
	 * @return void
	 */
	protected function attached($presenter)
	{
		if ($presenter instanceof Presenter) {
			$name = $this->lookupPath('Nette\Application\UI\Presenter');

			if (!isset($this->getElementPrototype()->id)) {
				$this->getElementPrototype()->id = 'frm-' . $name;
			}

			if (iterator_count($this->getControls()) && $this->isSubmitted()) {
				foreach ($this->getControls() as $control) {
					if (!$control->isDisabled()) {
						$control->loadHttpData();
					}
				}
			}

			if (!$this->getAction()) {
				$this->setAction(new Link($presenter, 'this', array()));
				$signal = new Nette\Forms\Controls\HiddenField($name . self::NAME_SEPARATOR . 'submit');
				$signal->setOmitted()->setHtmlId(FALSE);
				$this[Presenter::SIGNAL_KEY] = $signal;
			}
		}
		parent::attached($presenter);
	}
开发者ID:nakoukal,项目名称:fakturace,代码行数:32,代码来源:Form.php

示例2: attached

 /**
  * This method will be called when the component (or component's parent)
  * becomes attached to a monitored object. Do not call this method yourself.
  * @param  IComponent
  * @return void
  */
 protected function attached($presenter)
 {
     if ($presenter instanceof Presenter) {
         $name = $this->lookupPath('Nette\\Application\\Presenter');
         if (!isset($this->getElementPrototype()->id)) {
             $this->getElementPrototype()->id = 'frm-' . $name;
         }
         $this->setAction(new Link($presenter, $name . self::NAME_SEPARATOR . 'submit!', array()));
         // fill-in the form with HTTP data
         if ($this->isSubmitted()) {
             foreach ($this->getControls() as $control) {
                 $control->loadHttpData();
             }
         }
     }
     parent::attached($presenter);
 }
开发者ID:jff15,项目名称:travelbot,代码行数:23,代码来源:AppForm.php

示例3: attached

 /**
  * This method will be called when the component (or component's parent)
  * becomes attached to a monitored object. Do not call this method yourself.
  * @param  Nette\ComponentModel\IComponent
  * @return void
  */
 protected function attached($presenter)
 {
     if ($presenter instanceof Presenter) {
         if (!isset($this->getElementPrototype()->id)) {
             $this->getElementPrototype()->id = 'frm-' . $this->lookupPath(Presenter::class);
         }
         if (!$this->getAction()) {
             $this->setAction(new Link($presenter, 'this'));
         }
         $controls = $this->getControls();
         if (iterator_count($controls) && $this->isSubmitted()) {
             foreach ($controls as $control) {
                 if (!$control->isDisabled()) {
                     $control->loadHttpData();
                 }
             }
         }
         $this->onAnchor($this);
     }
     parent::attached($presenter);
 }
开发者ID:hrach,项目名称:nette-application,代码行数:27,代码来源:Form.php

示例4: attached

 protected function attached($obj)
 {
     parent::attached($obj);
     if ($obj instanceof Presenter) {
         if ($this->httpRequest === NULL) {
             $this->httpRequest = $obj->getContext()->getByType(IRequest::class);
         }
         $this->getElementPrototype()->action = substr($this->httpRequest->getUrl(), strlen($this->httpRequest->getUrl()->hostUrl));
         $name = $this->lookupPath(Presenter::class);
         if (!isset($this->getElementPrototype()->id)) {
             $this->getElementPrototype()->id = 'frm-' . $name;
         }
         $this[self::TRACKER_ID] = (new Controls\HiddenField($name))->setOmitted();
         if (iterator_count($this->getControls()) && $this->isSubmitted()) {
             foreach ($this->getControls() as $control) {
                 if (!$control->isDisabled()) {
                     $control->loadHttpData();
                 }
             }
         }
     }
 }
开发者ID:librette,项目名称:confirmation-dialog,代码行数:22,代码来源:ConfirmationForm.php


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