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


PHP Zend_Form_Element::getValue方法代码示例

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


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

示例1: aElement

 /**
  * Render element
  *
  * @param Zend_Form_Element $element
  * @return string
  */
 public function aElement(Zend_Form_Element $element)
 {
     $viewClasses = array($element->getAttrib('class'));
     if ($element->isRequired()) {
         if (!$element->getAttrib('title')) {
             $element->setAttrib('title', 'Field is required');
         }
         $viewClasses[] = 'aForm-field-required';
     }
     if ($element->getValidators()) {
         $viewClasses[] = 'aForm-field-validate';
     }
     if ($element->hasErrors()) {
         $viewClasses[] = 'aForm-field-invalid';
     } elseif ($element->getValue() || !$element->isRequired()) {
         $viewClasses[] = 'aForm-field-valid';
     }
     if ($element->getValidators()) {
         $viewClasses[] = 'aForm-field-validate';
     }
     $element->setAttrib('class', implode(' ', $viewClasses));
     $options = null;
     $separator = null;
     if ($element instanceof Zend_Form_Element_Multi) {
         $options = $element->getMultiOptions();
         $separator = $element->getSeparator();
     }
     return $this->view->{$element->helper}($element->getName(), $element->getValue(), $element->getAttribs(), $options, $separator);
 }
开发者ID:uglide,项目名称:zfcore-transition,代码行数:35,代码来源:AElement.php

示例2: isValid

 /**
  * @param mixed $value
  * @return booleans
  */
 public function isValid($value)
 {
     $db = Zend_Db_Table::getDefaultAdapter();
     $sql = 'SELECT
             m.id
         FROM
             meeting m LEFT JOIN event e ON (m.id_event = e.id)
         WHERE
             m.ghost = false
             AND (e.latest = true OR (e.latest IS NULL AND m.id_meeting_type = 6))
             AND m.id_meeting_type IN (3,4,6)
             AND
             (
                    (' . $db->quoteInto('m.meeting_at >= ?', $this->_objectEventAt->getValue()) . ' AND ' . $db->quoteInto('m.meeting_at + (m.length * interval \'1 minute\') <= timestamp ? + interval \'' . $this->_objectLength->getValue() . ' minutes\'', $this->_objectEventAt->getValue()) . ')
                 OR (' . $db->quoteInto('m.meeting_at <= ?', $this->_objectEventAt->getValue()) . ' AND ' . $db->quoteInto('m.meeting_at >= timestamp ?', $this->_objectEventAt->getValue()) . ')
                 OR (' . $db->quoteInto('m.meeting_at <= ?', $this->_objectEventAt->getValue()) . ' AND ' . $db->quoteInto('m.meeting_at + (m.length * interval \'1 minute\') >= timestamp ? + interval \'' . $this->_objectLength->getValue() . ' minutes\'', $this->_objectEventAt->getValue()) . ')
                 OR (' . $db->quoteInto('m.meeting_at < timestamp ? + interval \'' . $this->_objectLength->getValue() . ' minutes\'', $this->_objectEventAt->getValue()) . ' AND ' . $db->quoteInto('m.meeting_at + (m.length * interval \'1 minute\') >= timestamp ? + interval \'' . $this->_objectLength->getValue() . ' minutes\'', $this->_objectEventAt->getValue()) . ')
             )
             AND ' . $db->quoteInto('m.id_user = ?', Zend_Auth::getInstance()->getIdentity()->id) . '
             AND ' . $db->quoteInto('m.id_branch = ?', Zend_Auth::getInstance()->getIdentity()->id_branch);
     if ($this->_nextEvent !== false) {
         $sql .= ' AND ' . $db->quoteInto('m.id_event <> ?', $this->_nextEvent);
     }
     $rows = $db->query($sql);
     if ($rows->rowCount() > 0) {
         $this->_error(self::VISIT_EXISTS);
         return false;
     } else {
         return true;
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:35,代码来源:Visit.php

示例3: isValid

 /**
  * @param mixed $value
  * @return booleans
  */
 public function isValid($value)
 {
     if (count($this->_object->getValue()) >= count($this->_object->getMultiOptions())) {
         return true;
     } else {
         $this->_error(self::ALL_FIELDS_NOT_CHECKED);
         return false;
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:13,代码来源:RequiredAgreement.php

示例4: isValid

 /**
  * Overrides isValid() from Zend_Validate_Interface
  *
  * @param string $value
  * @access public
  * @return bool
  */
 public function isValid($value)
 {
     if (NULL === $this->_element) {
         require_once 'Zend/Exception.php';
         throw new Zend_Exception('You must add a Zend_Form_Element to the SameAs validator prior to calling the isValid() method');
     }
     if ($value != $this->_element->getValue()) {
         $this->_error(self::NOT_THE_SAME);
         return FALSE;
     }
     return TRUE;
 }
开发者ID:omusico,项目名称:logica,代码行数:19,代码来源:SameAs.php

示例5: getValue

 public function getValue($name = '')
 {
     $value = parent::getValue();
     if ($name) {
         $value = isset($value[$name]) ? $value[$name] : '';
     }
     return $value;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:8,代码来源:Budget.php

示例6: getValue

 /**
  * Get value
  *
  * If element type is one of the button types, returns the label.
  *
  * @param \Zend_Form_Element $element
  *
  * @return string|null
  */
 public function getValue($element)
 {
     if (!$element instanceof \Zend_Form_Element) {
         return null;
     }
     foreach ($this->_buttonTypes as $type) {
         if ($element instanceof $type) {
             if (stristr($type, 'submit')) {
                 $element->content = $element->getLabel();
                 return $element->getValue();
             }
             if (stristr($type, 'button')) {
                 $element->content = $element->getLabel();
                 return $element->getValue();
             }
             return $element->getLabel();
         }
     }
     return $element->getValue();
 }
开发者ID:tavy315,项目名称:twitter-bootstrap-zend-form-decorator,代码行数:29,代码来源:ViewHelper.php

示例7: getValue

 public function getValue()
 {
     $valueFiltered = parent::getValue();
     $tmp = array();
     if (!empty($valueFiltered)) {
         foreach ($valueFiltered as $value) {
             $_from = preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $value['from']) ? $value['from'] : '';
             $_to = preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $value['to']) || empty($value['to']) ? $value['to'] : $_from;
             if (!empty($_from)) {
                 array_push($tmp, array('from' => $_from, 'to' => $_to));
             }
         }
     }
     return $tmp;
 }
开发者ID:anunay,项目名称:stentors,代码行数:15,代码来源:DateRangePicker.php

示例8: getValue

 public function getValue($toString = true)
 {
     $value = parent::getValue();
     if (is_array($value)) {
         $xml = new SimpleXMLElement('<elementData />');
         foreach ($value as $k => $v) {
             $xml->{$k} = $v;
         }
     } else {
         $xml = simplexml_load_string($value);
     }
     if (is_object($xml)) {
         if ($toString) {
             return $xml->asXML();
         } else {
             return $xml;
         }
     } else {
         return null;
     }
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:21,代码来源:Xml.php

示例9: testPassingConfigObjectToConstructorSetsObjectState

 public function testPassingConfigObjectToConstructorSetsObjectState()
 {
     $config = new Zend_Config($this->getOptions());
     $element = new Zend_Form_Element($config);
     $this->assertEquals('changed', $element->getName());
     $this->assertEquals('foo', $element->getValue());
     $this->assertEquals('bar', $element->getLabel());
     $this->assertEquals(50, $element->getOrder());
     $this->assertFalse($element->isRequired());
     $this->assertEquals('bar', $element->foo);
     $this->assertEquals('bat', $element->baz);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:12,代码来源:ElementTest.php

示例10: prepareConfigElement

 /**
  * Remove cookie.jar if configs change and convert form password to password element
  * @param string $section
  * @param string $namespace
  * @param unknown_type $key
  * @param Zend_Form_Element $element
  * @param Zend_Form $form
  * @param Zend_Controller_Action $controller
  */
 public function prepareConfigElement($section, $namespace, $key, Zend_Form_Element $element, Zend_Form $form, Zend_Controller_Action $controller)
 {
     // nothing to do if this isn't the right section
     if ($namespace != $this->getId()) {
         return;
     }
     // remove cookie.jar if somethings has value
     if (!$form->isErrors() && !is_null($element->getValue())) {
         $this->clearLastCheck();
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:20,代码来源:UpdateNotifier.php

示例11: getValue

 /**
  * Get value
  *
  * If element type is one of the button types, returns the label.
  * 
  * @param  Zend_Form_Element $element 
  * @return string|null
  */
 public function getValue($element)
 {
     if (!$element instanceof Zend_Form_Element) {
         return null;
     }
     $type = $element->getType();
     if (in_array($type, $this->_buttonTypes)) {
         return $element->getLabel();
     }
     return $element->getValue();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:19,代码来源:ViewHelper.php

示例12: prepareConfigElement

 /**
  * Remove cookie.jar if configs change and convert form password to password element
  * @param string $section
  * @param string $namespace
  * @param unknown_type $key
  * @param Zend_Form_Element $element
  * @param Zend_Form $form
  * @param Zend_Controller_Action $controller
  */
 public function prepareConfigElement($section, $namespace, $key, Zend_Form_Element $element, Zend_Form $form, Zend_Controller_Action $controller)
 {
     // nothing to do if this isn't the right section
     if ($namespace != $this->getId()) {
         return;
     }
     switch ($key) {
         // i have to convert it to a password element
         case 'plugins_megavideo_premium_password':
             $password = $form->createElement('password', 'plugins_megavideo_premium_password', array('label' => $element->getLabel(), 'description' => $element->getDescription(), 'renderPassword' => true));
             $form->plugins_megavideo_premium_password = $password;
             break;
     }
     // remove cookie.jar if somethings has value
     if (!$form->isErrors() && !is_null($element->getValue()) && file_exists(APPLICATION_PATH . '/../data/megavideo/cookie.jar')) {
         if (@(!unlink(APPLICATION_PATH . '/../data/megavideo/cookie.jar'))) {
             X_Debug::e("Error removing cookie.jar");
         }
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:29,代码来源:Megavideo.php

示例13: getValue

 /**
  * Get value
  *
  * If element type is one of the button types, returns the label.
  * 
  * @param  Zend_Form_Element $element 
  * @return string|null
  */
 public function getValue($element)
 {
     if (!$element instanceof Zend_Form_Element) {
         return null;
     }
     foreach ($this->_buttonTypes as $type) {
         if ($element instanceof $type) {
             return $element->getLabel();
         }
     }
     return $element->getValue();
 }
开发者ID:quantm,项目名称:mywebprovn,代码行数:20,代码来源:ViewHelper.php

示例14: getInputHTML

 /**
  * Gets form element html
  *
  * @param Zend_Form_Element $element
  * @return string 
  */
 protected function getInputHTML($element)
 {
     $helper = $element->helper;
     $elBelongsTo = $element->getBelongsTo();
     if (!empty($this->belongsTo)) {
         $name = $this->mergeBelongsTo($this->belongsTo, $element->getBelongsTo());
         $name .= '[' . $element->getName() . ']';
     } else {
         if (!empty($elBelongsTo)) {
             $name = $this->mergeBelongsTo($elBelongsTo, $element->getName());
         } else {
             $name = $element->getName();
         }
     }
     $value = $element->getValue();
     //echo 'Name:'.$name.' | Class:'.  get_class($element).' | Helper:'.$helper.'['.$value.']'.'<br/>';
     return $element->getView()->{$helper}($name, $value, $element->getAttribs(), $element->options);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:24,代码来源:Abstract.php

示例15: decorateConfig

 public function decorateConfig($content, Zend_Form_Element $element, array $options)
 {
     $view = $this->getView();
     $value = $view->escape($element->getValue());
     return '<textarea name="' . $view->escape($element->getName()) . '"' . ' class="f-max-size" readonly="readonly"' . ' id="' . $view->escape($element->getId()) . '"' . ' rows="' . (substr_count($value, "\n") + 1) . '" cols="80" style="width: 100%;"' . '>' . $value . '</textarea>';
 }
开发者ID:EZ-NetTools,项目名称:ext-slave-dns-manager,代码行数:6,代码来源:View.php


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