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


PHP Object::extensionMethod方法代碼示例

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


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

示例1: register

 /**
  * Register TextInputCustomLabel
  * @param  string $control_name string
  * @return void
  */
 public static function register($control_name = 'addTextCustomLabel')
 {
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $control_name, function ($form, $name, $label = NULL, array $items = NULL) {
         $control = new self($label, $items);
         return $form[$name] = $control;
     });
 }
開發者ID:ublaboo,項目名稱:controls,代碼行數:12,代碼來源:TextInputCustomLabel.php

示例2: register

 public static function register($controlName = 'addMultiSelectFileChoicer')
 {
     if (!is_string($controlName)) {
         throw new Exception(sprintf('Control name must be string, %s given', gettype($controlName)));
     }
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $controlName, function ($form, $name, IManager $mediaManager, $namespace, $label = null, $withPrimary = true) {
         return $form[$name] = new \vojtabiberle\MediaStorage\Bridges\Nette\Forms\Controls\MultiSelectFileChoicer($mediaManager, $namespace, $label, $withPrimary);
     });
 }
開發者ID:vojtabiberle,項目名稱:MediaStorage,代碼行數:9,代碼來源:MultiSelectFileChoicer.php

示例3: register

 /**
  * Register NotTranslatableSelectBox
  * @param  string $control_name string
  * @return void
  */
 public static function register($control_name = 'addNotTranslatableSelect')
 {
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $control_name, function ($form, $name, $label = NULL, array $items = NULL, $size = NULL) {
         $control = new self($label, $items);
         if ($size > 1) {
             $control->setAttribute('size', (int) $size);
         }
         return $form[$name] = $control;
     });
 }
開發者ID:ublaboo,項目名稱:controls,代碼行數:15,代碼來源:NotTranslatableSelectBox.php

示例4: register

 /**
  * @param string $controlName
  * @throws ImageStorageException
  */
 public static function register($controlName = 'addMultiImageUpload')
 {
     if (!is_string($controlName)) {
         throw new ImageStorageException(sprintf('Control name must be a string, %s given', gettype($controlName)));
     }
     Object::extensionMethod(Container::class . '::' . $controlName, function ($form, $name, $label = NULL, $namespace = NULL) {
         $control = new self($label);
         $control->setNamespace($namespace);
         return $form[$name] = $control;
     });
 }
開發者ID:webchemistry,項目名稱:images,代碼行數:15,代碼來源:MultiUpload.php


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