当前位置: 首页>>代码示例>>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;未经允许,请勿转载。