當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JFormFieldList::setup方法代碼示例

本文整理匯總了PHP中JFormFieldList::setup方法的典型用法代碼示例。如果您正苦於以下問題:PHP JFormFieldList::setup方法的具體用法?PHP JFormFieldList::setup怎麽用?PHP JFormFieldList::setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JFormFieldList的用法示例。


在下文中一共展示了JFormFieldList::setup方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   object  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed   $value    The form field value to validate.
  * @param   string  $group    The field name group control value. This acts as as an array container for the field.
  *                            For example if the field has name="foo" and the group value is set to "bar" then the
  *                            full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @since   11.1
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     $defaultToTableValue = $this->element->attributes()->default_to_table;
     if ($defaultToTableValue) {
         $defaultToTableValue = (bool) $this->element->attributes()->{$defaultToTableValue}[0];
     } else {
         $defaultToTableValue = true;
     }
     if ($this->value == '' && $return && $defaultToTableValue) {
         $db = JFactory::getDbo();
         /*
          * Attempt to get the real Db collation (tmp fix before this makes it into J itself
          * see - https://github.com/joomla/joomla-cms/pull/2092
          */
         $db->setQuery('SHOW VARIABLES LIKE "collation_database"');
         try {
             $res = $db->loadObject();
             if (isset($res->Value)) {
                 $this->value = $res->Value;
             }
         } catch (RuntimeException $e) {
             $this->value = $db->getCollation();
         }
     }
     return $return;
 }
開發者ID:LGBGit,項目名稱:tierno,代碼行數:40,代碼來源:collation.php

示例2: testGetInput

	/**
	 * Test the getInput method.
	 */
	public function testGetInput()
	{
		$form = new JFormInspector('form1');

		$this->assertThat(
			$form->load('<form><field name="list" type="list" /></form>'),
			$this->isTrue(),
			'Line:'.__LINE__.' XML string should load successfully.'
		);

		$field = new JFormFieldList($form);

		$this->assertThat(
			$field->setup($form->getXml()->field, 'value'),
			$this->isTrue(),
			'Line:'.__LINE__.' The setup method should return true.'
		);

		$this->assertThat(
			strlen($field->input),
			$this->greaterThan(0),
			'Line:'.__LINE__.' The getInput method should return something without error.'
		);

		// TODO: Should check all the attributes have come in properly.
	}
開發者ID:realityking,項目名稱:JAJAX,代碼行數:29,代碼來源:JFormFieldListTest.php

示例3: setup

 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     // On change must always be the change context function
     $this->onchange = 'dpFieldsChangeContext(jQuery(this).val());';
     return $return;
 }
開發者ID:beingsane,項目名稱:DPFields,代碼行數:7,代碼來源:section.php

示例4: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->folder = (string) $this->element['folder'];
     }
     return $return;
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:22,代碼來源:plugins.php

示例5: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->allowAdd = isset($this->element['allowAdd']) ? $this->element['allowAdd'] : '';
     }
     return $return;
 }
開發者ID:adjaika,項目名稱:J3Base,代碼行數:22,代碼來源:categoryedit.php

示例6: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value';
         $this->valueField = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name'];
         $this->translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
         $this->query = (string) $this->element['query'];
     }
     return $return;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:25,代碼來源:sql.php

示例7: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->filter = (string) $this->element['filter'];
         $this->exclude = (string) $this->element['exclude'];
         $this->stripPrefix = (string) $this->element['stripprefix'];
         $this->defaultLabel = (string) $this->element['defaultlabel'];
         $hideNone = (string) $this->element['hide_none'];
         $this->hideNone = $hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1';
         $hideDefault = (string) $this->element['hide_default'];
         $this->hideDefault = $hideDefault == 'true' || $hideDefault == 'hideDefault' || $hideDefault == '1';
         $stripExt = (string) $this->element['stripext'];
         $this->stripExt = $stripExt == 'true' || $stripExt == 'stripExt' || $stripExt == '1';
         // Get the path in which to search for file options.
         $this->directory = (string) $this->element['directory'];
     }
     return $return;
 }
開發者ID:khetsothea,項目名稱:flexicontent-cck,代碼行數:33,代碼來源:fcfilelist.php

示例8: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the `<field>` tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->checkedOptions = (string) $this->element['checked'];
     }
     return $return;
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:22,代碼來源:checkboxes.php

示例9: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         // Check if its using the old way
         $this->query = (string) $this->element['query'];
         if (empty($this->query)) {
             // Get the query from the form
             $query = array();
             $defaults = array();
             $query['select'] = (string) $this->element['sql_select'];
             $query['from'] = (string) $this->element['sql_from'];
             $query['join'] = isset($this->element['sql_join']) ? (string) $this->element['sql_join'] : '';
             $query['where'] = isset($this->element['sql_where']) ? (string) $this->element['sql_where'] : '';
             $query['group'] = isset($this->element['sql_group']) ? (string) $this->element['sql_group'] : '';
             $query['order'] = (string) $this->element['sql_order'];
             // Get the filters
             $filters = isset($this->element['sql_filter']) ? explode(",", $this->element['sql_filter']) : '';
             // Get the default value for query if empty
             if (is_array($filters)) {
                 foreach ($filters as $key => $val) {
                     $name = "sql_default_{$val}";
                     $attrib = (string) $this->element[$name];
                     if (!empty($attrib)) {
                         $defaults[$val] = $attrib;
                     }
                 }
             }
             // Process the query
             $this->query = $this->processQuery($query, $filters, $defaults);
         }
         $this->keyField = isset($this->element['key_field']) ? (string) $this->element['key_field'] : 'value';
         $this->valueField = isset($this->element['value_field']) ? (string) $this->element['value_field'] : (string) $this->element['name'];
         $this->translate = isset($this->element['translate']) ? (string) $this->element['translate'] : false;
         $this->header = $this->element['header'] ? (string) $this->element['header'] : false;
     }
     return $return;
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:52,代碼來源:sql.php

示例10: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement $element   The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed            $value     The form field value to validate.
  * @param   string           $group     The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   1.2.0
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $attributes = array('exclude', 'class');
         /* class is @deprecated >= J3.2 */
         foreach ($attributes as $attributeName) {
             if (isset($element[$attributeName])) {
                 $this->__set($attributeName, $element[$attributeName]);
             }
         }
     }
     return $return;
 }
開發者ID:fields-and-filters,項目名稱:fields-and-filters,代碼行數:28,代碼來源:fieldsandfiltersstates.php

示例11: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $input = \Windwalker\DI\Container::getInstance()->get('input');
     $this->container = \Windwalker\DI\Container::getInstance($input->get('option'));
     return parent::setup($element, $value, $group);
 }
開發者ID:ForAEdesWeb,項目名稱:AEW3,代碼行數:17,代碼來源:fieldtype.php


注:本文中的JFormFieldList::setup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。