当前位置: 首页>>代码示例>>PHP>>正文


PHP Control::createComponent方法代码示例

本文整理汇总了PHP中Nette\Application\UI\Control::createComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::createComponent方法的具体用法?PHP Control::createComponent怎么用?PHP Control::createComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Application\UI\Control的用法示例。


在下文中一共展示了Control::createComponent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createComponent

 /**
  * @param string $name
  * @return IComponent
  */
 protected function createComponent($name)
 {
     $component = parent::createComponent($name);
     if ($component instanceof \Nette\Forms\Form) {
         $component->setTranslator($this->translator);
     }
     return $component;
 }
开发者ID:shophp,项目名称:shophp,代码行数:12,代码来源:BaseControl.php

示例2: createComponent

 protected function createComponent($name)
 {
     if (isset($this->controlFactories[$name])) {
         $controlFactory = $this->controlFactories[$name];
         return $controlFactory->create();
     }
     return parent::createComponent($name);
 }
开发者ID:rebendajirijr,项目名称:container-control,代码行数:8,代码来源:ContainerControl.php

示例3: createComponent

 /**
  * @param string
  * @return \Nette\ComponentModel\IComponent
  */
 protected function createComponent($name)
 {
     $method = 'createComponent' . ucfirst($name);
     if (method_exists($this, $method)) {
         $this->checkRequirements($this->getReflection()->getMethod($method));
     }
     return parent::createComponent($name);
 }
开发者ID:jedenweb,项目名称:framework,代码行数:12,代码来源:Control.php

示例4: createComponent

 /**
  * Component factory. Delegates the creation of components to a createComponent<Name> method.
  *
  * @param  string      component name
  * @return IComponent  the created component (optionally)
  */
 protected function createComponent($name)
 {
     // parent
     if (($control = parent::createComponent($name)) == TRUE) {
         return $control;
     }
     // widget from widgetManager
     if ($this->presenter->widgetManager->hasWidget($name)) {
         return $this->presenter->widgetManager->getWidget($name)->invoke();
     }
     throw new \Nette\InvalidArgumentException("Component or widget with name '{$name}' does not exist.");
 }
开发者ID:svobodni,项目名称:web,代码行数:18,代码来源:Control.php

示例5: createComponent

	/**
	 * Component factory. Delegates the creation of components to a createComponent<Name> method.
	 * @param  string
	 * @return \Nette\ComponentModel\IComponent
	 */
	protected function createComponent($name)
	{
		$container = $this->getContext()->components;
		if ($container->hasComponent($name)) {
			return $container->getComponent($name, $this);
		}

		return parent::createComponent($name);
	}
开发者ID:norbe,项目名称:framework,代码行数:14,代码来源:Control.php

示例6: createComponent

 /**
  * @param string $name
  * @return \Nette\ComponentModel\IComponent
  */
 protected function createComponent($name)
 {
     $this->load();
     return parent::createComponent($name);
 }
开发者ID:lohini,项目名称:cf,代码行数:9,代码来源:TreeViewNode.php

示例7: createComponent

 protected function createComponent($name) : Nette\ComponentModel\IComponent
 {
     return parent::createComponent($name) ?: $this->getPresenter()->createComponent($name);
 }
开发者ID:ytnuk,项目名称:application,代码行数:4,代码来源:Control.php

示例8: createComponent

 /**
  * Creates Component
  *
  * priority: props, $this->componentFactory(), createComponent<Name> methods
  * @param  string      component name
  * @return IComponent  the created component (optionally)
  */
 protected final function createComponent($name)
 {
     if ($this->props->hasProp('onComponentCreate')) {
         $component = $this->props->onComponentCreate($this, $name);
         if ($component) {
             return $component;
         }
     }
     $component = $this->onComponentCreate($this, $name);
     if ($component) {
         return $component;
     }
     $component = parent::createComponent($name);
     if ($component) {
         return $component;
     }
     //stub control
     $props = new Props();
     $props->templatePath = __DIR__ . '/templates/no-control.latte';
     /*$props->onRender = function (RaControl $control) {
           if ($control->getParent() instanceOf StubControl) {
               $control->getParent()->render();
               return false;
           }
           return true; //continue rendering
       };*/
     return new StubControl($props);
 }
开发者ID:jasir,项目名称:Ra,代码行数:35,代码来源:RaControl.php

示例9: createComponent

 protected function createComponent($name)
 {
     $control = parent::createComponent($name);
     $this->prepareComponent($name, $control);
     return $control;
 }
开发者ID:zaxxx,项目名称:zaxcms,代码行数:6,代码来源:Control.php


注:本文中的Nette\Application\UI\Control::createComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。