本文整理汇总了PHP中AbstractForm::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractForm::__construct方法的具体用法?PHP AbstractForm::__construct怎么用?PHP AbstractForm::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractForm
的用法示例。
在下文中一共展示了AbstractForm::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Creates a new AllianceAdministrationForm object.
*/
public function __construct()
{
if (!defined('DO_NOT_PARSE_ALLIANCE_TEXTS')) {
define('DO_NOT_PARSE_ALLIANCE_TEXTS', true);
}
parent::__construct();
}
示例2: __construct
/**
* Creates a new LoginForm object.
*/
public function __construct()
{
if (WCF::getUser()->userID) {
throw new PermissionDeniedException();
}
parent::__construct();
}
示例3: __construct
public function __construct(Smarty $smarty, Context $context, TranslatorInterface $translator, CustomerFormatter $formatter, CustomerPersister $customerPersister, array $urls)
{
parent::__construct($smarty, $translator, $formatter);
$this->context = $context;
$this->urls = $urls;
$this->customerPersister = $customerPersister;
}
示例4: __construct
/**
* Constructor method to instantiate the form object
*
* @param string $action
* @param string $method
* @param int $tid
* @param boolean $profile
* @param int $uid
* @param \Phire\Auth\Acl $acl
* @param boolean $register
* @return self
*/
public function __construct($action = null, $method = 'post', $tid = 0, $profile = false, $uid = 0, $acl = null, $register = false)
{
parent::__construct($action, $method, null, ' ');
// Create user type fields/form first
if ($tid == 0) {
$typesAry = array();
$types = Table\UserTypes::findAll('id ASC');
foreach ($types->rows as $type) {
if ($acl->isAuth('Phire\\Controller\\Phire\\User\\IndexController', 'add_' . $type->id)) {
$typesAry[$type->id] = $type->type;
}
}
$this->initFieldsValues = array('type_id' => array('type' => 'select', 'required' => true, 'label' => $this->i18n->__('Select User Type'), 'value' => $typesAry, 'attributes' => array('style' => 'margin: 0 10px 0 0; padding: 6px 5px 7px 5px; height: 32px;')), 'submit' => array('type' => 'submit', 'value' => $this->i18n->__('SELECT'), 'attributes' => array('class' => 'save-btn', 'style' => 'margin: 0; padding: 5px 6px 6px 6px; width: 100px; height: 32px;')));
$id = 'user-select-form';
// Else, create initial user fields
} else {
$this->initFieldsValues = $this->getInitFields($tid, $profile, $uid, $action, $register);
if (strpos($action, '/install/user') !== false) {
$id = 'user-install-form';
} else {
if ($profile) {
$id = 'user-install-form';
} else {
$id = 'user-form';
}
}
}
$this->setAttributes('id', $id);
}
示例5: __construct
/**
* Constructor method to instantiate the form object
*
* @param string $action
* @param string $method
* @param int $sid
* @return self
*/
public function __construct($action = null, $method = 'post', $sid = 0)
{
parent::__construct($action, $method, null, ' ');
$fieldGroups = array();
$dynamicFields = false;
$model = str_replace('Form', 'Model', get_class($this));
$newFields = \Phire\Model\Field::getByModel($model, 0, $sid);
if ($newFields['dynamic']) {
$dynamicFields = true;
}
if ($newFields['hasFile']) {
$this->hasFile = true;
}
foreach ($newFields as $key => $value) {
if (is_numeric($key)) {
$fieldGroups[] = $value;
}
}
$fields1 = array('title' => array('type' => 'text', 'label' => $this->i18n->__('Title'), 'required' => true, 'attributes' => array('size' => 80)), 'domain' => array('type' => 'text', 'label' => $this->i18n->__('Domain'), 'required' => true, 'attributes' => array('size' => 80)), 'document_root' => array('type' => 'text', 'label' => $this->i18n->__('Document Root'), 'required' => true, 'attributes' => array('size' => 80)), 'base_path' => array('type' => 'text', 'label' => $this->i18n->__('Base Path'), 'attributes' => array('size' => 80)));
if ($sid != 0) {
$fields1['domain']['attributes']['onkeyup'] = "phire.updateTitle('#site-header-title', this);";
}
$fields2 = array('submit' => array('type' => 'submit', 'value' => $this->i18n->__('SAVE'), 'attributes' => array('class' => 'save-btn')), 'update' => array('type' => 'button', 'value' => $this->i18n->__('UPDATE'), 'attributes' => array('onclick' => "return phire.updateForm('#site-form', " . ($this->hasFile || $dynamicFields ? 'true' : 'false') . ");", 'class' => 'update-btn')), 'force_ssl' => array('type' => 'radio', 'label' => $this->i18n->__('Force SSL'), 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '0'), 'live' => array('type' => 'radio', 'label' => $this->i18n->__('Live'), 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '1'), 'id' => array('type' => 'hidden', 'value' => 0), 'update_value' => array('type' => 'hidden', 'value' => 0));
$allFields = array($fields2);
if (count($fieldGroups) > 0) {
foreach ($fieldGroups as $fg) {
$allFields[] = $fg;
}
}
$allFields[] = $fields1;
$this->initFieldsValues = $allFields;
$this->setAttributes('id', 'site-form');
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->compact = true;
$this->labelWidth = 4;
$this->controlWidth = 8;
$this->addText('domain_name', 'Domain Name')->addText('domain_name_short', 'Short Domain Name')->addText('domain_controller', 'Domain Controller')->addText('ldap_port', 'LDAP Port Number')->addText('user', 'Username')->addPassword('password', 'Password')->addText('use_start_tls', 'Use Start TLS')->addText('baseDn', 'Base DN')->addButton('submit', 'Submit', 'btn-primary');
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'spec_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'label', 'options' => array('label' => 'Label')));
$this->add(array('name' => 'value', 'options' => array('label' => 'Value')));
}
示例8: __construct
public function __construct()
{
parent::__construct();
$this->labelWidth = 3;
$this->controlWidth = 9;
$this->compact = true;
$this->addText('name', 'Name')->addText('host', 'Hostname')->addText('port', 'Port')->addText('ssl', 'SSL')->addText('username', 'Username')->addPassword('password', 'Password')->addButton('submit', 'Submit', 'btn-primary');
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'option_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'choice_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'override_name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
}
示例10: __construct
/**
* Constructor method to instantiate the form object
*
* @param string $action
* @param string $method
* @return self
*/
public function __construct($action = null, $method = 'post')
{
parent::__construct($action, $method, null, ' ');
$this->initFieldsValues = array('name' => array('type' => 'text', 'label' => $this->i18n->__('Name & Order'), 'required' => true, 'attributes' => array('size' => 40, 'style' => 'width: 376px;')), 'order' => array('type' => 'text', 'attributes' => array('size' => 3), 'value' => 0), 'dynamic' => array('type' => 'radio', 'label' => $this->i18n->__('Dynamic') . '?', 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '0'), 'id' => array('type' => 'hidden', 'value' => 0), 'update_value' => array('type' => 'hidden', 'value' => 0), 'submit' => array('type' => 'submit', 'label' => ' ', 'value' => $this->i18n->__('SAVE'), 'attributes' => array('class' => 'save-btn', 'style' => 'width: 190px;')), 'update' => array('type' => 'button', 'value' => $this->i18n->__('UPDATE'), 'attributes' => array('onclick' => "return phire.updateForm('#field-group-form', false);", 'class' => 'update-btn', 'style' => 'width: 190px;')));
if (strpos($_SERVER['REQUEST_URI'], '/edit/') !== false) {
$this->initFieldsValues['name']['attributes']['onkeyup'] = "phire.updateTitle('#field-group-title', this);";
}
$this->setAttributes('id', 'field-group-form');
}
示例11: __construct
public function __construct(Smarty $smarty, Context $context, TranslatorInterface $translator, CustomerLoginFormatter $formatter, array $urls)
{
parent::__construct($smarty, $translator, $formatter);
$this->context = $context;
$this->translator = $translator;
$this->formatter = $formatter;
$this->urls = $urls;
$this->constraintTranslator = new ValidateConstraintTranslator($this->translator);
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'quantity', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Quantity')));
$this->add(array('name' => 'price', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Price')));
$this->add(array('name' => 'retail', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Retail')));
$this->add(array('name' => 'enabled', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('type' => 'select', 'options' => array(1 => 'Yes', 0 => 'No')), 'options' => array('label' => 'Enabled')));
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
$this->add(array('name' => 'description', 'attributes' => array('type' => 'textarea'), 'options' => array('label' => 'Description')));
$this->add(array('name' => 'item_number', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Item Number')));
$this->add(array('name' => 'product_type_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('type' => 'select', 'options' => array('1' => 'Shell', '2' => 'Product')), 'options' => array('label' => 'Product Type')));
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'uom_code', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'quantity', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'distributor_item_number', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Dist Item#')));
$this->add(array('name' => 'distributor_uom_code', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Dist UOM')));
$this->add(array('name' => 'cost', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Cost')));
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'option_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'choice_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Option Group Name (size, color, etc.)')));
$this->add(array('name' => 'instruction', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Instruction')));
$this->add(array('name' => 'required', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Required')));
$this->add(array('name' => 'builder', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('options' => array('0' => 'False', '1' => 'True')), 'options' => array('label' => 'Builder')));
$this->add(array('name' => 'option_type_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('options' => array('' => '---------', '1' => 'Select Box', '2' => 'Radio Buttons', '3' => 'Checkboxes')), 'options' => array('label' => 'Display Options As')));
}