本文整理汇总了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);
}
示例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);
}
示例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]);
}
}
示例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
示例5: attached
protected function attached($component)
{
parent::attached($component);
$this->componentControlAttached($component);
}