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


PHP Container::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * @param SeznamCaptcha $provider
  */
 public function __construct(SeznamCaptcha $provider)
 {
     parent::__construct();
     $this->provider = $provider;
     $this->validator = new CaptchaValidator($provider);
     $this['image'] = new CaptchaImage('Captcha', $provider);
     $this['code'] = new CaptchaInput('Code');
     $this['hash'] = new CaptchaHash($provider);
 }
開發者ID:minetro,項目名稱:seznamcaptcha,代碼行數:12,代碼來源:CaptchaContainer.php

示例2: __construct

 /**
  * Form constructor.
  * @param  string
  */
 public function __construct($name = NULL)
 {
     if ($name !== NULL) {
         $this->getElementPrototype()->id = 'frm-' . $name;
         $tracker = new Controls\HiddenField($name);
         $tracker->setOmitted();
         $this[self::TRACKER_ID] = $tracker;
     }
     parent::__construct(NULL, $name);
 }
開發者ID:Richmond77,項目名稱:learning-nette,代碼行數:14,代碼來源:Form.php

示例3: __construct

 /**
  * @param callable $factory
  * @param int $createDefault
  * @param bool $forceDefault
  *
  * @throws \Nette\InvalidArgumentException
  */
 public function __construct($factory, $createDefault = 0, $forceDefault = FALSE)
 {
     parent::__construct();
     $this->monitor('Nette\\Application\\UI\\Presenter');
     try {
         $this->factoryCallback = Callback::closure($factory);
     } catch (Nette\InvalidArgumentException $e) {
         $type = is_object($factory) ? 'instanceof ' . get_class($factory) : gettype($factory);
         throw new Nette\InvalidArgumentException('Replicator requires callable factory, ' . $type . ' given.', 0, $e);
     }
     $this->createDefault = (int) $createDefault;
     $this->forceDefault = $forceDefault;
 }
開發者ID:JedenWeb,項目名稱:Replicator,代碼行數:20,代碼來源:Container.php

示例4: __construct

 public function __construct(Nette\Forms\ControlGroup $group = NULL, Brabijan\SeoComponents\Router\Target $target = NULL)
 {
     parent::__construct();
     $this->target = $target;
     if ($group) {
         $this->currentGroup = $group;
     }
     $this->addText("seoTitle", "Title:");
     $this->addTextArea("seoKeywords", "Keywords:");
     $this->addTextArea("seoDescription", "Description:");
     $this->addSelect("seoRobots", "Robots:", array("index" => "index", "noindex" => "noindex"));
     $this->addSelect("sitemapChangeFreq", "Sitemap change frequency:", array("always" => "always", "hourly" => "hourly", "daily" => "daily", "weekly" => "weekly", "monthly" => "monthly", "yearly" => "yearly", "never" => "never"));
     $this->addText("sitemapPriority", "Sitemap priority:")->setType("number")->setRequired()->setAttribute("step", "0.1")->addRule(Nette\Application\UI\Form::FLOAT, "Priority must be number between 0 and 1")->addRule(Nette\Application\UI\Form::RANGE, "Priority must be number between 0 and 1", array(0, 1));
     $this->addText("route", "Route:")->setRequired()->addFilter(function ($val) {
         return ltrim($val, "/");
     });
 }
開發者ID:brabijan,項目名稱:nette-seo-components,代碼行數:17,代碼來源:SeoContainer.php

示例5: __construct

 /**
  * Form constructor.
  * @param  string
  */
 public function __construct($name = NULL)
 {
     $this->element = Nette\Utils\Html::el('form');
     $this->element->action = '';
     // RFC 1808 -> empty uri means 'this'
     $this->element->method = self::POST;
     $this->element->id = $name === NULL ? NULL : 'frm-' . $name;
     $this->monitor(__CLASS__);
     if ($name !== NULL) {
         $tracker = new Controls\HiddenField($name);
         $tracker->unmonitor(__CLASS__);
         $this[self::TRACKER_ID] = $tracker;
     }
     parent::__construct(NULL, $name);
 }
開發者ID:vrtak-cz,項目名稱:nette-doctrine-sandbox,代碼行數:19,代碼來源:Form.php

示例6: __construct

 public function __construct($factory)
 {
     parent::__construct();
     $this->factory = Callback::check($factory);
 }
開發者ID:kysela-petr,項目名稱:generator-kysela,代碼行數:5,代碼來源:LazyContainer.php

示例7: __construct

 /**
  * @param callable $callable_set_container
  */
 public function __construct(callable $callable_set_container)
 {
     parent::__construct();
     $this->monitor('Nette\\Application\\UI\\Presenter');
     $this->callable_set_container = $callable_set_container;
 }
開發者ID:ublaboo,項目名稱:datagrid,代碼行數:9,代碼來源:ItemDetailForm.php

示例8: __construct

 public function __construct($containerFactory)
 {
     parent::__construct();
     $this->containerFactory = callback($containerFactory);
     $this->collection = new ArrayCollection();
 }
開發者ID:kuba1999,項目名稱:DoctrineForms,代碼行數:6,代碼來源:ToManyContainer.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->monitor('Nette\\Forms\\Form');
 }
開發者ID:blitzik,項目名稱:vycetky-doctrine,代碼行數:5,代碼來源:BaseFormContainer.php


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