本文整理匯總了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);
}