当前位置: 首页>>代码示例>>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;未经允许,请勿转载。