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


PHP BaseControl::attached方法代码示例

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


在下文中一共展示了BaseControl::attached方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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\Forms\IComponent
  * @return void
  */
 protected function attached($form)
 {
     if ($form instanceof Nette\Forms\Form) {
         if ($form->getMethod() !== Nette\Forms\Form::POST) {
             throw new Nette\InvalidStateException('File upload requires method POST.');
         }
         $form->getElementPrototype()->enctype = 'multipart/form-data';
     }
     parent::attached($form);
 }
开发者ID:cujan,项目名称:atlas-mineralov-a-hornin,代码行数:16,代码来源:UploadControl.php

示例2: attached

 /**
  * @param \Nette\ComponentModel\Container $parent
  * @throws \Nette\InvalidStateException
  * @return void
  */
 protected function attached($parent)
 {
     if ($parent instanceof Nette\Forms\Form) {
         if ($parent->getMethod() !== Nette\Forms\Form::POST) {
             throw new Nette\InvalidStateException('File upload requires method POST.');
         }
         $parent->getElementPrototype()->enctype = 'multipart/form-data';
     } elseif ($parent instanceof Nette\Application\UI\Presenter) {
         if (!$this->httpRequest) {
             $this->httpRequest = $parent->getContext()->httpRequest;
             $this->httpResponse = $parent->getContext()->httpResponse;
         }
     }
     parent::attached($parent);
 }
开发者ID:fvozar,项目名称:images,代码行数:20,代码来源:UploadControl.php

示例3: attached

 /**
  * @param $component
  */
 protected function attached($component)
 {
     parent::attached($component);
     if ($component instanceof Nette\Application\IPresenter) {
         $this->presenter = $component;
         // build links
         $this->remoteLink = $this->link($component, 'remote!', ['q' => self::QUERY_PLACEHOLDER]);
     }
 }
开发者ID:vojtys,项目名称:typeahead,代码行数:12,代码来源:TypeaheadInput.php

示例4:

__construct($label=NULL){parent::__construct($label);$this->control->type='file';}protected
function
attached($form){if($form
instanceof
Nette\Forms\Form){if($form->getMethod()!==Nette\Forms\Form::POST){throw
new
Nette\InvalidStateException('File upload requires method POST.');}$form->getElementPrototype()->enctype='multipart/form-data';}parent::attached($form);}function
开发者ID:JanTvrdik,项目名称:NetteExtras,代码行数:7,代码来源:loader.php

示例5: attached

 protected function attached($component)
 {
     parent::attached($component);
     $this->componentControlAttached($component);
 }
开发者ID:nextras,项目名称:forms,代码行数:5,代码来源:ComponentControl.php


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