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


PHP CForm::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($path, $model)
 {
     $this->model = $model;
     list($module, $form) = explode(".", $path, 2);
     $form_path = "application.modules.{$module}.forms.{$form}";
     parent::__construct($form_path, $model);
 }
开发者ID:nizsheanez,项目名称:documentation,代码行数:7,代码来源:BaseForm.php

示例2: __construct

 /**
 * Constructor
 */
 public function __construct($content)
 {
     parent::__construct();
     $this->content = $content;
     $save = isset($content['id']) ? 'save' : 'create';
     $this->AddElement(new CFormElementHidden('id', array('value' => $content['id'])))->AddElement(new CFormElementText('title', array('value' => $content['title'])))->AddElement(new CFormElementText('key', array('value' => $content['key'])))->AddElement(new CFormElementTextarea('data', array('label' => 'Content:', 'value' => $content['data'])))->AddElement(new CFormElementText('type', array('value' => $content['type'])))->AddElement(new CFormElementText('filter', array('value' => $content['filter'])))->AddElement(new CFormElementSubmit($save, array('callback' => array($this, 'DoSave'), 'callback-args' => array($content))))->AddElement(new CFormElementSubmit('delete', array('callback' => array($this, 'DoDelete'), 'callback-args' => array($content))));
     $this->SetValidation('title', array('not_empty'))->SetValidation('key', array('not_empty'));
 }
开发者ID:xd3x4L-1,项目名称:page,代码行数:11,代码来源:CFormContent.php

示例3: array

 function __construct(&$ZBX_CONFIG)
 {
     $this->DISABLE_NEXT_BUTTON = false;
     $this->ZBX_CONFIG =& $ZBX_CONFIG;
     $this->stage = array(0 => array('title' => '1. Introduction', 'fnc' => 'stage0'), 1 => array('title' => '2. Licence Agreement', 'fnc' => 'stage1'), 2 => array('title' => '3. Check of pre-requisites', 'fnc' => 'stage2'), 3 => array('title' => '4. Configure DB connection', 'fnc' => 'stage3'), 4 => array('title' => '5. ZABBIX server details', 'fnc' => 'stage4'), 5 => array('title' => '6. Pre-Installation Summary', 'fnc' => 'stage5'), 6 => array('title' => '7. Install', 'fnc' => 'stage6'), 7 => array('title' => '8. Finish', 'fnc' => 'stage7'));
     $this->EventHandler();
     parent::__construct(null, 'post');
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:8,代码来源:setup.inc.php

示例4: __construct

 /** Create all form elements and validation rules in the constructor.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $items = array('tomato', 'potato', 'apple', 'pear', 'banana');
     $shoppingcart = array('potato', 'pear');
     $this->AddElement(new CFormElementCheckboxMultiple('items', array('values' => $items, 'checked' => $shoppingcart)));
     $this->AddElement(new CFormElementSubmit('submit', array('callback' => array($this, 'DoSubmit'))));
 }
开发者ID:Kajja,项目名称:phpmvc,代码行数:11,代码来源:test_checkbox_multiple.php

示例5: array

 function __construct(&$ZBX_CONFIG)
 {
     $this->DISABLE_NEXT_BUTTON = false;
     $this->ZBX_CONFIG =& $ZBX_CONFIG;
     $this->stage = array(0 => array('title' => '1. Welcome', 'fnc' => 'stage1'), 1 => array('title' => '2. Check of pre-requisites', 'fnc' => 'stage2'), 2 => array('title' => '3. Configure DB connection', 'fnc' => 'stage3'), 3 => array('title' => '4. Zabbix server details', 'fnc' => 'stage4'), 4 => array('title' => '5. Pre-Installation summary', 'fnc' => 'stage5'), 5 => array('title' => '6. Install', 'fnc' => 'stage6'));
     $this->eventHandler();
     parent::__construct('post');
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:8,代码来源:setup.inc.php

示例6: __construct

 /** Create all form elements and validation rules in the constructor.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $items = array('tomato', 'potato', 'apple', 'pear', 'banana');
     $shoppingcart = array('potato', 'pear');
     foreach ($items as $item) {
         $this->AddElement(new CFormElementCheckbox($item, array('value' => $item, 'label' => $item, 'checked' => in_array($item, $shoppingcart))));
     }
     $this->AddElement(new CFormElementSubmit('submit', array('callback' => array($this, 'DoSubmit'))));
 }
开发者ID:Kajja,项目名称:phpmvc,代码行数:13,代码来源:test_checkbox1.php

示例7: __construct

 public function __construct($title = null, $action = null, $method = null, $enctype = null, $form_variable = null)
 {
     $method = is_null($method) ? 'post' : $method;
     parent::__construct($method, $action, $enctype);
     $this->setTitle($title);
     $form_variable = is_null($form_variable) ? 'form' : $form_variable;
     $this->addVar($form_variable, get_request($form_variable, 1));
     $this->bottom_items = new CCol(SPACE, 'form_row_last');
     $this->bottom_items->setColSpan(2);
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:10,代码来源:class.cformtable.php

示例8: create

 /**
  * Constructor
  *
  */
 public function create($successCallback, $values = null)
 {
     parent::__construct();
     $message = $values ? $values['message'] : "";
     $email = $values ? $values['email'] : "";
     $name = $values ? $values['name'] : "";
     $id = $values ? $values['id'] : "";
     $this->AddElement(new CFormElementText('message', ['value' => $message]))->AddElement(new CFormElementText('name', ['value' => $name]))->AddElement(new CFormElementText('email', ['value' => $email]))->AddElement(new CFormElementHidden('id', ['value' => $id]))->AddElement(new CFormElementSubmit('submit', array('callback' => $successCallback)))->AddElement(new CFormElementSubmit('submit-fail', array('callback' => array($this, 'DoSubmitFail'))));
     return $this;
 }
开发者ID:sebastianjonasson,项目名称:phpmvcprojekt,代码行数:14,代码来源:CommentForm.php

示例9: CFrontendSetup

 function __construct()
 {
     $this->DISABLE_CANCEL_BUTTON = false;
     $this->DISABLE_BACK_BUTTON = false;
     $this->SHOW_RETRY_BUTTON = false;
     $this->STEP_FAILED = false;
     $this->frontendSetup = new CFrontendSetup();
     $this->stage = [0 => ['title' => _('Welcome'), 'fnc' => 'stage0'], 1 => ['title' => _('Check of pre-requisites'), 'fnc' => 'stage1'], 2 => ['title' => _('Configure DB connection'), 'fnc' => 'stage2'], 3 => ['title' => _('Zabbix server details'), 'fnc' => 'stage3'], 4 => ['title' => _('Pre-installation summary'), 'fnc' => 'stage4'], 5 => ['title' => _('Install'), 'fnc' => 'stage5']];
     $this->eventHandler();
     parent::__construct('post');
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:11,代码来源:CSetupWizard.php

示例10: create

 /**
  * Constructor
  *
  */
 public function create($successCallback, $user = null)
 {
     parent::__construct();
     $acronym = $user ? $user->acronym : "";
     $email = $user ? $user->email : "";
     $name = $user ? $user->name : "";
     $id = $user ? $user->id : "";
     $password = $user ? $user->password : "";
     $this->AddElement(new CFormElementText('acronym', ['value' => $acronym]))->AddElement(new CFormElementText('name', ['value' => $name]))->AddElement(new CFormElementText('email', ['value' => $email]))->AddElement(new CFormElementHidden('id', ['value' => $id]))->AddElement(new CFormElementPassword('password', ['value' => $password]))->AddElement(new CFormElementSubmit('submit', array('callback' => $successCallback)))->AddElement(new CFormElementSubmit('submit-fail', array('callback' => array($this, 'DoSubmitFail'))));
     return $this;
 }
开发者ID:sebastianjonasson,项目名称:phpmvcprojekt,代码行数:15,代码来源:UserForm.php

示例11: __construct

 public function __construct($config, $model = null, $parent = null)
 {
     $side = Yii::app()->controller instanceof AdminController ? 'admin' : 'client';
     if ($this->back_button_show === null) {
         $this->back_button_show = $side == 'admin';
     }
     if (is_string($config)) {
         $config = self::getFullAlias($config);
     }
     parent::__construct($config, $model, $parent);
     $this->addAttributesToButtons();
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:12,代码来源:Form.php

示例12: __construct

 /** Create all form elements and validation rules in the constructor.
  *
  */
 public function __construct()
 {
     parent::__construct();
     /*
         $this->AddElement(new CFormElementText('name', array('label'=>'Name of contact person:', 'required'=>true)))
              ->AddElement(new CFormElementText('email', array('required'=>true)))
              ->AddElement(new CFormElementText('phone', array('required'=>true))); */
     $this->AddElement(new CFormElementCheckbox('accept_mail', array('label' => 'It´s great if you send me product information by mail.', 'checked' => false)))->AddElement(new CFormElementCheckbox('accept_phone', array('label' => 'You may call me to try and sell stuff.', 'checked' => true)))->AddElement(new CFormElementCheckbox('accept_agreement', array('label' => 'You must accept the <a href=http://opensource.org/licenses/GPL-3.0>license agreement</a>.', 'required' => true)))->AddElement(new CFormElementSubmit('submit', array('callback' => array($this, 'DoSubmit'))))->AddElement(new CFormElementSubmit('submit-fail', array('callback' => array($this, 'DoSubmitFail'))));
     /*$this->SetValidation('name', array('not_empty'))
       ->SetValidation('email', array('not_empty'))
       ->SetValidation('phone', array('not_empty', 'numeric')); */
     $this->SetValidation('accept_agreement', array('must_accept'));
 }
开发者ID:Kajja,项目名称:phpmvc,代码行数:16,代码来源:test_checkbox.php

示例13: __construct

 public function __construct($config, $model = null, $parent = null)
 {
     if ($this->side == null) {
         $this->side = Yii::app()->controller instanceof AdminController ? 'admin' : 'client';
     }
     if ($this->inputElementClass == null) {
         $this->inputElementClass = ucfirst($this->side) . 'FormInputElement';
     }
     if (is_string($config)) {
         $config = self::getFullAlias($config);
     }
     parent::__construct($config, $model, $parent);
     $this->addAttributesToButtons();
     $this->formatDateAttributes();
 }
开发者ID:nizsheanez,项目名称:kur.ru,代码行数:15,代码来源:BaseForm.php

示例14: __construct

 /** Create all form elements and validation rules in the constructor.
  *
  */
 public function __construct()
 {
     parent::__construct();
     $tests = array('not_empty' => 'not_empty', 'numeric' => 'numeric', 'mail_address' => 'mail_address');
     $testKeys = array_keys($tests);
     $this->AddElement(new CFormElementText('Enter-a-value', array()))->AddElement(new CFormElementCheckboxMultiple('items', array('description' => 'Choose the validation rules to use.', 'values' => $testKeys, 'checked' => null)))->AddElement(new CFormElementSubmit('submit', array('callback' => array($this, 'DoSubmit'))));
     if (!empty($_POST['items'])) {
         $validation = array();
         foreach ($_POST['items'] as $val) {
             $validation[] = $tests[$val];
         }
         //echo "<pre>" . print_r($validation, true) . "</pre>";
         $this->SetValidation('Enter-a-value', $validation);
     }
 }
开发者ID:Kajja,项目名称:phpmvc,代码行数:18,代码来源:test_validation.php

示例15: __construct

 public function __construct($title = null, $action = null, $method = null, $enctype = null, $form_variable = null)
 {
     $this->top_items = array();
     $this->center_items = array();
     $this->bottom_items = array();
     $this->tableclass = 'formtable';
     if (null == $method) {
         $method = 'post';
     }
     if (null == $form_variable) {
         $form_variable = 'form';
     }
     parent::__construct($action, $method, $enctype);
     $this->setTitle($title);
     $this->setAlign('center');
     $this->setHelp();
     $this->addVar($form_variable, get_request($form_variable, 1));
     $this->addVar('form_refresh', get_request('form_refresh', 0) + 1);
     $this->bottom_items = new CCol(SPACE, 'form_row_last');
     $this->bottom_items->setColSpan(2);
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:21,代码来源:class.cformtable.php


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