當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Form::attached方法代碼示例

本文整理匯總了PHP中Nette\Application\UI\Form::attached方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::attached方法的具體用法?PHP Form::attached怎麽用?PHP Form::attached使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\Application\UI\Form的用法示例。


在下文中一共展示了Form::attached方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attached

 protected function attached($presenter)
 {
     parent::attached($presenter);
     if ($presenter instanceof Nette\Application\IPresenter) {
         $this->onAttached($this);
     }
 }
開發者ID:sw2eu,項目名稱:form-factory,代碼行數:7,代碼來源:Form.php

示例2: attached

 /**
  * @param \Nette\ComponentModel\Container $obj
  */
 protected function attached($obj)
 {
     if ($obj instanceof \Nette\Application\IPresenter) {
         $this->attachHandlers();
     }
     parent::attached($obj);
 }
開發者ID:lohini,項目名稱:framework,代碼行數:10,代碼來源:Form.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\Application\IComponent
	 * @return void
	 */
	protected function attached($presenter)
	{
		parent::attached($presenter);
		if ($this->getContext()->hasService('translator')) {
			$this->setTranslator($this->getContext()->translator);
		}
	}
開發者ID:norbe,項目名稱:framework,代碼行數:13,代碼來源:Form.php

示例4: attached

 protected function attached($presenter)
 {
     parent::attached($presenter);
     if ($presenter instanceof \Nette\Application\UI\Presenter) {
         $this->builder->setDefaults($this);
     }
 }
開發者ID:voda,項目名稱:formbuilder,代碼行數:7,代碼來源:EntityForm.php

示例5: attached

 protected function attached($control)
 {
     parent::attached($control);
     if (!is_array($this->onSuccess)) {
         $this->onSuccess = [];
     }
     array_unshift($this->onSuccess, function () {
         $this->flashMessage($this->formatFlashMessage('success'), 'success');
     });
     $this->onSuccess[] = function () {
         if (!$this->getPresenter()->isAjax()) {
             $this->getControl()->redirect('this');
         }
     };
     if (!is_array($this->onError)) {
         $this->onError = [];
     }
     array_unshift($this->onError, function () {
         $this->flashMessage($this->formatFlashMessage('error'), 'danger');
     });
     if (!is_array($this->onSubmit)) {
         $this->onSubmit = [];
     }
     array_unshift($this->onSubmit, function () {
         $this->getControl()->redrawControl();
     });
 }
開發者ID:ytnuk,項目名稱:form,代碼行數:27,代碼來源:Form.php

示例6: attached

 /**
  * @param \Nette\ComponentModel\Container $parent
  */
 protected function attached($parent)
 {
     parent::attached($parent);
     if ($parent instanceof Control) {
         $this->setRenderer(new \FoundationFormRenderer\Renderer());
     }
 }
開發者ID:frosty22,項目名稱:ale,代碼行數:10,代碼來源:Form.php

示例7: attached

 /**
  * @param \Nette\ComponentModel\IComponent $component
  */
 protected function attached($component)
 {
     parent::attached($component);
     if (!$component instanceof Presenter) {
         return;
     }
     $this->configure($component);
 }
開發者ID:brosland,項目名稱:framework,代碼行數:11,代碼來源:Form.php

示例8: attached

 /**
  * @param Nette\Application\IPresenter
  */
 protected function attached($presenter)
 {
     parent::attached($presenter);
     if ($presenter instanceof Nette\Application\IPresenter) {
         $this->beforeSetup();
         $this->setup();
     }
 }
開發者ID:jedenweb,項目名稱:newsletter,代碼行數:11,代碼來源:NewsletterForm.php

示例9: attached

 /**
  * Autofocus AJAX handling.
  *
  * @param $presenter
  */
 public function attached($presenter)
 {
     parent::attached($presenter);
     if ($this->autofocus !== NULL) {
         $this[$this->autofocus]->setAttribute('autofocus');
         if ($presenter->isAjax()) {
             $presenter->payload->focus = $this[$this->autofocus]->getHtmlId();
         }
     }
 }
開發者ID:zaxxx,項目名稱:zaxcms,代碼行數:15,代碼來源:Form.php

示例10: attached

 public function attached($presenter)
 {
     parent::attached($presenter);
     /** @var App\GameModule\DTO\Unit $unit */
     foreach ($this->units as $unit) {
         $this->addText($unit->getId() . 'number', $unit->getName())->setAttribute('class', 'text')->addCondition(Nette\Forms\Form::NUMERIC);
     }
     $this->addSubmit('submit', 'Train')->setAttribute('type', 'image')->setAttribute('class', 'dynamic_img')->setAttribute('id', 'btn_train');
     return $this;
 }
開發者ID:Spameri,項目名稱:TravianZ,代碼行數:10,代碼來源:TrainControl.php

示例11: attached

 protected function attached($parent)
 {
     parent::attached($parent);
     if (!$parent instanceof UI\Presenter || !Debugger::isEnabled()) {
         return;
     }
     Debugger::$bar->addPanel($this);
     $this->addText('destination', 'Destination')->addRule($this::FILLED, 'Je třeba zadat destinaci.')->getControlPrototype()->placeholder = 'Please enter destination';
     $this->addSubmit('redirect', 'Redirect')->onClick[] = callback($this, 'processRedirect');
     $this->addSubmit('showLink', 'Show link')->onClick[] = callback($this, 'processShowLink');
 }
開發者ID:zkrat,項目名稱:nette-goto-panel,代碼行數:11,代碼來源:GotoPanel.php

示例12: 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)
 {
     parent::attached($presenter);
     if (empty($this->uploadDir)) {
         $this->cache = new Nette\Caching\Cache($this->presenter->context->getService('cacheStorage'), 'nette-plupload');
         $this->uploadDir = $this->presenter->context->expand('%tempDir%') . '/nette-plupload-files';
         if (!is_dir($this->uploadDir) && !mkdir($this->uploadDir, 0775, TRUE)) {
             throw new \RuntimeException(sprintf('Cannot create upload dir %s', $this->uploadDir));
         }
     }
 }
開發者ID:doublemcz,項目名稱:nette-plupload,代碼行數:17,代碼來源:Form.php

示例13: attached

 /**
  * @param $presenter
  */
 public function attached($presenter)
 {
     parent::attached($presenter);
     $renderer = new BootstrapRenderer();
     $this->setRenderer($renderer);
     if ($presenter instanceof Presenter) {
         $this->setTranslator($presenter->getTranslator());
         if ($presenter->isAjax()) {
             $this->getElementPrototype()->class[] = 'ajax';
         }
     }
 }
開發者ID:peterzadori,項目名稱:movi,代碼行數:15,代碼來源:Form.php

示例14: attached

 /**
  * @param \Nette\ComponentModel\Container
  */
 protected function attached($obj)
 {
     if ($obj instanceof Nette\Application\IPresenter) {
         if ($this->getComponents()->count() === 0) {
             # form was created by operator new
             $this->beforeSetup();
             $this->setup();
             $this->afterSetup();
         }
         $this->attachHandlers();
     }
     parent::attached($obj);
 }
開發者ID:jedenweb,項目名稱:framework,代碼行數:16,代碼來源:Form.php

示例15: attached

 /**
  * @param \Nette\ComponentModel\Container $obj
  */
 protected function attached($obj)
 {
     parent::attached($obj);
     if ($this->mapper) {
         $this->mapper->assign($this->data, $this);
     }
     $this->onAttached($this);
     if ($obj instanceof \Nette\Application\UI\Presenter) {
         if (!$this->isSubmitted()) {
             if ($this->mapper) {
                 $this->mapper->load();
             }
             $this->onLoad($this);
         }
     }
 }
開發者ID:svobodni,項目名稱:web,代碼行數:19,代碼來源:Form.php


注:本文中的Nette\Application\UI\Form::attached方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。