當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。