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


PHP Container::addCheckbox方法代碼示例

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


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

示例1: generateForm

 public function generateForm(Items\Base $item, Nette\Forms\Container &$formContainer, $name, $parentName, $togglingObject, array $userOptions = [])
 {
     $input = $formContainer->addCheckbox($name, $name);
     $input->setOption('id', $parentName . '__' . $name);
     $input->setValue($item->getContent());
     if (!is_null($togglingObject)) {
         $togglingObject->toggle($input->getOption('id'));
     }
     $item->applyUserOptions($input, $userOptions);
 }
開發者ID:trejjam,項目名稱:contents,代碼行數:10,代碼來源:BoolSubType.php

示例2: createImageUpload

 protected function createImageUpload(Nette\Forms\Container $container, $image)
 {
     $id = $this->lookupPath('Nette\\Application\\UI\\Presenter') . '-form';
     if ($image !== NULL) {
         $container->addCheckbox('deleteImg', 'common.form.removeImage')->addCondition(Form::EQUAL, FALSE)->toggle($id . '-pic-customize');
     }
     $container->addFileUpload('img', 'common.form.image')->setOption('id', $id . '-pic-image')->addCondition(Form::FILLED)->addRule(Form::IMAGE);
     // upload is filled => show img options
     $container['img']->addCondition(Form::FILLED)->toggle($id . '-pic-customize');
     // has image and deleteImg is checked => show upload
     if ($image !== NULL) {
         $container['deleteImg']->addCondition(Form::EQUAL, TRUE)->toggle($id . '-pic-image');
     }
 }
開發者ID:zaxxx,項目名稱:zaxcms,代碼行數:14,代碼來源:AbstractFormControl.php

示例3: addCheckers

 /**
  * @param \Nette\Forms\Container $container
  * @throws Exception
  * @internal
  */
 public function addCheckers(\Nette\Forms\Container $container)
 {
     $items = $this->grid->getData();
     $primaryKey = $this->getPrimaryKey();
     foreach ($items as $item) {
         try {
             $primaryValue = $this->grid->getProperty($item, $primaryKey);
             if (!isset($container[$primaryValue])) {
                 $container->addCheckbox(Helpers::formatColumnName($primaryValue))->controlPrototype->title = $primaryValue;
             }
         } catch (\Exception $e) {
             throw new Exception('You should define some else primary key via $grid->setPrimaryKey() ' . "because currently defined '{$primaryKey}' key is not suitable for operation feature.");
         }
     }
 }
開發者ID:Kaliver,項目名稱:grido,代碼行數:20,代碼來源:Operation.php

示例4: addCheckers

 /**
  * @param \Nette\Forms\Container $container
  * @internal
  */
 public function addCheckers(\Nette\Forms\Container $container)
 {
     $items = $this->grid->getData();
     $primaryKey = $this->getPrimaryKey();
     $propertyAccessor = $this->grid->getPropertyAccessor();
     foreach ($items as $item) {
         $primaryValue = $propertyAccessor->getProperty($item, $primaryKey);
         if (!isset($container[$primaryValue])) {
             $container->addCheckbox(Helpers::formatColumnName($primaryValue));
         }
     }
 }
開發者ID:cujan,項目名稱:vcelyweb,代碼行數:16,代碼來源:Operation.php


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