本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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, "/");
});
}
示例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);
}
示例6: __construct
public function __construct($factory)
{
parent::__construct();
$this->factory = Callback::check($factory);
}
示例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;
}
示例8: __construct
public function __construct($containerFactory)
{
parent::__construct();
$this->containerFactory = callback($containerFactory);
$this->collection = new ArrayCollection();
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->monitor('Nette\\Forms\\Form');
}