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


PHP JModelForm類代碼示例

本文整理匯總了PHP中JModelForm的典型用法代碼示例。如果您正苦於以下問題:PHP JModelForm類的具體用法?PHP JModelForm怎麽用?PHP JModelForm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: testValidatePassesDataAndGroupToJform

 /**
  * Test JModelForm::validate
  *
  * @since   3.4
  *
  * @return  void
  *
  * @testdox validate() passes data and group to JForm
  */
 public function testValidatePassesDataAndGroupToJform()
 {
     $data = array("a" => "b");
     $group = "groupy";
     $formMock = $this->getMockBuilder('JForm')->disableOriginalConstructor()->getMock();
     $formMock->expects($this->once())->method('validate')->with($data, $group)->willReturn(true);
     $formMock->expects($this->once())->method('filter')->with($data)->will($this->returnArgument(0));
     $this->object->validate($formMock, $data, $group);
 }
開發者ID:Rai-Ka,項目名稱:joomla-cms,代碼行數:18,代碼來源:JModelFormTest.php

示例2: __construct

 public function __construct($config = array())
 {
     $udbPath = UserNotesHelper::userDataPath() . '/usernotes.db3';
     $db = JDatabaseDriver::getInstance(array('driver' => 'sqlite', 'database' => $udbPath));
     $config['dbo'] = $db;
     parent::__construct($config);
 }
開發者ID:ron4mac,項目名稱:joomla_com_usernotes,代碼行數:7,代碼來源:edit.php

示例3: getItem

 /**
  * Method to get the record form.
  *
  * @param   string  $pk  Private key.
  *
  * @since   2.2
  * @return   null
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         // Do any procesing on fields here if needed
     }
     return $item;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:15,代碼來源:zoneform.php

示例4:

 function __construct()
 {
     parent::__construct();
     $this->projectid = JRequest::getInt('p', 0);
     $this->ptid = JRequest::getInt('ptid', 0);
     $this->tid = JRequest::getInt('tid', 0);
 }
開發者ID:santas156,項目名稱:joomleague-2-komplettpaket,代碼行數:7,代碼來源:editprojectteam.php

示例5: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  * @since    1.6
  */
 protected function populateState()
 {
     parent::populateState();
     $app = JFactory::getApplication("Site");
     /** @var $app JApplicationSite * */
     // Get the pk of the record from the request.
     $value = $app->input->getInt("id");
     $this->setState($this->getName() . '.id', $value);
 }
開發者ID:phpsource,項目名稱:CrowdFunding,代碼行數:14,代碼來源:friendmail.php

示例6: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     global $ext_name_com, $ext_prefix;
     $this->ext_name_com = $ext_name_com;
     $this->ext_prefix = $ext_prefix;
     $this->context .= $this->getName() && ($layout = JRequest::getVar('layout', 'default')) ? '.' . $layout : '';
     $this->params = JComponentHelper::getParams($this->ext_name_com);
 }
開發者ID:JexyRu,項目名稱:Ksenmart,代碼行數:9,代碼來源:modelksform.php

示例7: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since    1.6
  */
 protected function populateState()
 {
     parent::populateState();
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite */
     // Load the parameters.
     $value = $app->getParams($this->option);
     $this->setState('params', $value);
 }
開發者ID:xop32,項目名稱:Proof-of-Identity,代碼行數:16,代碼來源:proof.php

示例8: getForm

 /**
  * Method to get a form object.
  *
  * @return	mixed		A JForm object on success, false on failure.
  * @since	1.6
  */
 public function getForm()
 {
     // Get the form.
     $form = parent::getForm('application', 'com_config.application', array('array' => 'jform', 'event' => 'onPrepareForm'));
     // Check for an error.
     if (JError::isError($form)) {
         $this->setError($form->getMessage());
         return false;
     }
     return $form;
 }
開發者ID:joebushi,項目名稱:joomla,代碼行數:17,代碼來源:application.php

示例9: preprocessForm

 protected function preprocessForm(JForm $form, $data, $group = 'contact')
 {
     $userParams = JComponentHelper::getParams('com_contact');
     // Deal with captcha
     $captcha = $userParams->get('captcha', '0');
     if ($captcha === '0') {
         $form->removeField('captcha');
     } else {
         $form->setFieldAttribute('captcha', 'plugin', $captcha);
     }
     parent::preprocessForm($form, $data, 'user');
 }
開發者ID:ngxuanmui,項目名稱:hanhphuc.vn,代碼行數:12,代碼來源:contact.php

示例10: populateState

 protected function populateState()
 {
     $app = JFactory::getApplication();
     $id = JRequest::getInt($this->pk_name);
     $this->setState(strtolower($this->model_key) . '.' . $this->pk_name, $id);
     $cmd = JRequest::getCmd('cmd', '');
     $this->setState(strtolower($this->model_key) . '.cmd', $cmd);
     // Load the parameters.
     $params = $app->getParams();
     $this->setState('params', $params);
     parent::populateState();
 }
開發者ID:acculitx,項目名稱:fleetmatrixsite,代碼行數:12,代碼來源:baseedit.php

示例11: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  * @since    1.6
  */
 protected function populateState()
 {
     parent::populateState();
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite */
     // Get the pk of the record from the request.
     $value = $app->input->getInt('id');
     $this->setState($this->getName() . '.id', $value);
     // Load the parameters.
     $params = $app->getParams();
     $this->setState('params', $params);
 }
開發者ID:ITPrism,項目名稱:CrowdfundingDistribution,代碼行數:17,代碼來源:friendmail.php

示例12: getForm

 /**
  * Method to get the record form.
  *
  * @return	mixed	JForm object on success, false on failure.
  * @since	1.6
  */
 public function getForm()
 {
     // Get the form.
     $form = parent::getForm('download', 'com_banners.download', array('array' => 'jform'));
     // Check for an error.
     if (JError::isError($form)) {
         $this->setError($form->getMessage());
         return false;
     }
     $form->setValue('basename', $this->getState('basename'));
     $form->setValue('compressed', $this->getState('compressed'));
     return $form;
 }
開發者ID:joebushi,項目名稱:joomla,代碼行數:19,代碼來源:download.php

示例13: getForm

 /**
  * Method to get the record form.
  *
  * @return	mixed	JForm object on success, false on failure.
  */
 public function getForm()
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     // Get the form.
     $form = parent::getForm('config', 'com_messages.config', array('array' => 'jform', 'event' => 'onPrepareForm'));
     // Check for an error.
     if (JError::isError($form)) {
         $this->setError($form->getMessage());
         return false;
     }
     return $form;
 }
開發者ID:joebushi,項目名稱:joomla,代碼行數:18,代碼來源:config.php

示例14: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  * @since    1.6
  */
 protected function populateState()
 {
     parent::populateState();
     $app = JFactory::getApplication("Site");
     /** @var $app JApplicationSite * */
     // Get the pk of the record from the request.
     $value = $app->input->getInt("id");
     $this->setState('item_id', $value);
     $value = $app->input->getInt("comment_id");
     $this->setState('comment_id', $value);
     // Load the parameters.
     $value = $app->getParams($this->option);
     $this->setState('params', $value);
 }
開發者ID:pippogsm,項目名稱:UserIdeas,代碼行數:19,代碼來源:comment.php

示例15: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  * @since    1.6
  */
 protected function populateState()
 {
     parent::populateState();
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite */
     // Get the pk of the record from the request.
     $value = $app->input->getInt("id", 0);
     $this->setState($this->getName() . '.id', $value);
     // Get category ID
     $value = $app->getUserState($this->option . ".items.catid");
     $this->setState('category_id', $value);
     // Load the parameters.
     $value = $app->getParams($this->option);
     $this->setState('params', $value);
 }
開發者ID:johngrange,項目名稱:wookeyholeweb,代碼行數:20,代碼來源:form.php


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