本文整理汇总了PHP中Zend_Form_Element_File::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_File::setValue方法的具体用法?PHP Zend_Form_Element_File::setValue怎么用?PHP Zend_Form_Element_File::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_File
的用法示例。
在下文中一共展示了Zend_Form_Element_File::setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testValueGetAndSet
public function testValueGetAndSet()
{
$this->element->setTransferAdapter(new Zend_Form_Element_FileTest_MockAdapter());
$this->assertEquals(null, $this->element->getValue());
$this->element->setValue('something');
$this->assertEquals(null, $this->element->getValue());
}
示例2: frmuser
public function frmuser($frm = null)
{
$db = new Application_Model_DbTable_DbGlobal();
$status = new Zend_Form_Element_Select('status');
$_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
$status->setMultiOptions($_arr_status);
$status->setAttribs(array('class' => 'form-control validate[required]'));
$id_code = new Zend_Form_Element_Text('id_code');
$id_code->setAttribs(array('class' => 'form-control validate[required]'));
$fullname = new Zend_Form_Element_Text('fullname');
$fullname->setAttribs(array('class' => 'form-control validate[required]'));
$username = new Zend_Form_Element_Text('username');
$username->setAttribs(array('class' => 'form-control validate[required]', 'Onkeyup' => 'getfillterUserType()'));
$email = new Zend_Form_Element_Text('email');
$email->setAttribs(array('class' => 'validate[required,custom[email]] form-control', 'Onkeyup' => 'getfillterUserType()'));
$old_password = new Zend_Form_Element_Password('old_password');
$old_password->setAttribs(array('class' => 'validate[required,minSize[5]] form-control'));
$password = new Zend_Form_Element_Password('password');
$password->setAttribs(array('class' => 'validate[required,minSize[5]] form-control'));
$confirm_password = new Zend_Form_Element_Password('confirm_password');
$confirm_password->setAttribs(array('class' => 'validate[required,equals[password]] form-control'));
$rs = $db->getGlobalDb('SELECT user_type_id,user_type FROM tb_user_type where user_type_id');
$options = array('' => '--- ជ្រើសរើសប្រភេទអ្នកប្រើប្រាស់ ---');
foreach ($rs as $read) {
$options[$read['user_type_id']] = $read['user_type'];
}
$user_type_id = new Zend_Form_Element_Select('user_type');
$user_type_id->setMultiOptions($options);
$user_type_id->setAttribs(array('id' => 'user_type_id', 'class' => 'form-control chzn-select validate[required]'));
$id = new Zend_Form_Element_Hidden('id');
$photo = new Zend_Form_Element_File('photo');
$this->addElements(array($status, $id_code, $photo, $id, $fullname, $username, $email, $password, $confirm_password, $user_type_id, $old_password));
if ($frm != "") {
$id->setValue($frm['user_id']);
$fullname->setValue($frm['name']);
$username->setValue($frm['user_name']);
$email->setValue($frm['email']);
$id_code->setValue($frm['user_code']);
// $password->setValue($frm['password']);
$user_type_id->setValue($frm['user_type']);
$photo->setValue($frm['photo']);
$status->setValue($frm['status']);
}
return $this;
}
示例3: testCanPrependFileToContent
public function testCanPrependFileToContent()
{
$element = new Zend_Form_Element_File('foo');
$element->setValue('foobar')->setView($this->getView());
$this->decorator->setElement($element)->setOption('placement', 'prepend');
$file = $this->decorator->render('content');
$this->assertRegexp('#<input[^>]*>.*?(content)#s', $file, $file);
}
示例4: FrmAddCO
public function FrmAddCO($_data = null)
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
$_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("SEARCH_STAFF_INFO")));
$_title->setValue($request->getParam("adv_search"));
$_status_search = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
$_status_search->setAttribs(array('dojoType' => $this->filter));
$_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
$_status_search->setMultiOptions($_status_opt);
$_status_search->setValue($request->getParam("status_search"));
$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
$_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
$_co_id = new Zend_Dojo_Form_Element_TextBox('co_id');
$_co_id->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
$_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
$db = new Application_Model_DbTable_DbGlobal();
$rows = $db->getAllBranchName();
$options = '';
if (!empty($rows)) {
foreach ($rows as $row) {
$options[$row['br_id']] = $row['branch_namekh'];
}
}
$_branch_id->setMultiOptions($options);
$_name_kh = new Zend_Dojo_Form_Element_TextBox('name_kh');
$_name_kh->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
$_enname = new Zend_Dojo_Form_Element_TextBox('first_name');
$_enname->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
$_lname = new Zend_Dojo_Form_Element_TextBox('last_name');
$_lname->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
$_sex = new Zend_Dojo_Form_Element_FilteringSelect('co_sex');
$_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
$opt = array(1 => "Male", 2 => "Femail");
$_sex->setMultiOptions($opt);
$_tel = new Zend_Dojo_Form_Element_TextBox('tel');
$_tel->setAttribs(array('dojoType' => $this->tvalidate, 'class' => 'fullside'));
$_position = new Zend_Dojo_Form_Element_FilteringSelect('position');
$_position->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
$db = new Application_Model_DbTable_DbGlobal();
$opt = $db->getAllStaffPosition(null, 1);
$_position->setMultiOptions($opt);
$_department = new Zend_Dojo_Form_Element_FilteringSelect('department_id');
$_department->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside', 'OnChange' => 'popupDepartment()'));
$db = new Application_Model_DbTable_DbGlobal();
$opt = $db->getAllDepartment(null, 1);
$_department->setMultiOptions($opt);
$_figer_print_id = new Zend_Dojo_Form_Element_TextBox('figer_print_id');
$_figer_print_id->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
$_email = new Zend_Dojo_Form_Element_ValidationTextBox('email');
$_email->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside'));
// $pattern="/^[a-zA-Z]+[a-zA-Z0-9]*@[a-zA-Z]+[a-zA-Z0-9][a-zA-Z]{2,4}([a-zA-Z]{2,4})?$/";
// if(preg_match($pattern,$_email));
$_national_id = new Zend_Dojo_Form_Element_TextBox('national_id');
$_national_id->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
$_address = new Zend_Dojo_Form_Element_TextBox('address');
$_address->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
$_pob = new Zend_Dojo_Form_Element_TextBox('pob');
$_pob->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
$_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
$_status->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
$_status->setMultiOptions($_status_opt);
$_display = new Zend_Dojo_Form_Element_FilteringSelect('display');
$_display->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$_display_opt = array(1 => $this->tr->translate("NAME_KHMER"), 2 => $this->tr->translate("NAME_ENGLISH"));
$_display->setMultiOptions($_display_opt);
$_degree = new Zend_Dojo_Form_Element_FilteringSelect('degree');
$_degree->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
$degree_opt = $db->getAllDegree();
$_degree->setMultiOptions($degree_opt);
$_degree->setValue($request->getParam('degree'));
$_basic_salary = new Zend_Dojo_Form_Element_NumberTextBox('basic_salary');
$_basic_salary->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
$_start_work = new Zend_Dojo_Form_Element_DateTextBox('start_date');
$_start_work->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'onchange' => 'calculateDay();'));
$_start_work->setValue(date('Y-m-d'));
$_end_work = new Zend_Dojo_Form_Element_DateTextBox('end_date');
$_end_work->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
$_photo = new Zend_Form_Element_File('photo');
$_end_work->setValue(date('Y-m-d'));
$_contract = new Zend_Dojo_Form_Element_TextBox('contract_no');
$_contract->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
$_note = new Zend_Dojo_Form_Element_TextBox('note');
$_note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
$opt_shift = array(1 => 'ពេញម៉ោង', 2 => 'ក្រៅម៉ោង');
$_shift = new Zend_Dojo_Form_Element_FilteringSelect('shift');
$_shift->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'Checktime(2)'));
$_shift->setMultiOptions($opt_shift);
$opt_workingtime = array(1 => 'ពេលព្រឹក និង ពេលល្ងាច', 2 => 'ពេលព្រឹក', 3 => 'ពេលល្ងាច');
$_workingtime = new Zend_Dojo_Form_Element_FilteringSelect('workingtime');
$_workingtime->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'Checktime(1)'));
$_workingtime->setMultiOptions($opt_workingtime);
$_annual_lives = new Zend_Dojo_Form_Element_NumberTextBox('annual_lives');
$_annual_lives->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
$_id = new Zend_Form_Element_Hidden('id');
if (!empty($_data)) {
$_co_id->setValue($_data['co_code']);
$_name_kh->setValue($_data['co_khname']);
//.........这里部分代码省略.........
示例5: FrmAddClient
//.........这里部分代码省略.........
$options=array(''=>"---Select Branch Name---");
if(!empty($rows))foreach($rows AS $row) $options[$row['br_id']]=$row['displayby']==1?$row['branch_namekh']:$row['branch_nameen'];
$_branch_id->setMultiOptions($options);
$_member = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
$_member->setAttribs(array(
'dojoType'=>'dijit.form.FilteringSelect',
'class'=>'fullside',
'onchange'=>'getGroupCode();'
));
$db = new Application_Model_DbTable_DbGlobal();
$rows = $db->getClientByType(1);
$options=array(''=>"---Select Group Name---");
if(!empty($rows))foreach($rows AS $row) $options[$row['client_id']]=$row['name_en'];
$_member->setMultiOptions($options);
$_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
$_namekh->setAttribs(array(
'dojoType'=>'dijit.form.ValidationTextBox',
'class'=>'fullside',
'required' =>'true'
));
$id_client = $db->getNewClientId();
$_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
$_clientno->setAttribs(array(
'dojoType'=>'dijit.form.TextBox',
'class'=>'fullside',
'readonly'=>'readonly',
'style'=>'color:red;'
));
$_clientno->setValue($id_client);
$_nameen = new Zend_Dojo_Form_Element_ValidationTextBox('name_en');
$_nameen->setAttribs(array(
'dojoType'=>'dijit.form.ValidationTextBox',
'class'=>'fullside',
'required' =>'true'
));
$_join_with = new Zend_Dojo_Form_Element_TextBox('join_with');
$_join_with->setAttribs(array(
'dojoType'=>'dijit.form.TextBox',
'class'=>'fullside',
));
$_join_nation_id = new Zend_Dojo_Form_Element_TextBox('join_nation_id');
$_join_nation_id->setAttribs(array(
'dojoType'=>'dijit.form.TextBox',
'class'=>'fullside',
));
$_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
$_sex->setAttribs(array(
'dojoType'=>'dijit.form.FilteringSelect',
'class'=>'fullside',
));
// $opt = array(1=>"Male",2=>"Femail");
$opt_status = $db->getVewOptoinTypeByType(11,1);
unset($opt_status[-1]);
unset($opt_status['']);
$_sex->setMultiOptions($opt_status);