예제 #1
0
 public function testSmartyTextboxWithPostback()
 {
     $this->_server->SetForm($this->_expectedName, $this->_expectedValue);
     $this->_smarty->_Value = 'somewrongvalue';
     $textbox = new SmartyTextbox($this->_formKey, null, $this->_templateVar, $this->_attributes, $this->_smarty);
     $expectedHtml = $this->BuildExpectedSmartyTextbox();
     $this->assertEquals($expectedHtml, $textbox->Html());
 }
예제 #2
0
 public function Textbox($params, &$smarty)
 {
     $class = null;
     $value = null;
     $size = null;
     $tabindex = null;
     $type = null;
     if (isset($params['class'])) {
         $class = $params['class'];
     }
     if (isset($params['value'])) {
         $value = $params['value'];
     }
     if (isset($params['size'])) {
         $size = $params['size'];
     }
     if (isset($params['tabindex'])) {
         $tabindex = $params['tabindex'];
     }
     if (isset($params['type'])) {
         $type = strtolower($params['type']);
     }
     $id = null;
     if (isset($params['id'])) {
         $id = $params['id'];
     }
     $knownAttributes = array('value', 'type', 'name');
     $attributes = $this->AppendAttributes($params, $knownAttributes);
     if ($type == 'password') {
         $textbox = new SmartyPasswordbox($params['name'], $id, $value, $attributes, $smarty);
     } else {
         $textbox = new SmartyTextbox($params['name'], $id, $value, $attributes, $smarty);
     }
     return $textbox->Html();
 }