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


PHP JApplicationWeb::triggerEvent方法代码示例

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


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

示例1: update

 /**
  * Method to update an object in the database.
  *
  * @return  JContent  The content object.
  *
  * @since   12.1
  * @throws  LogicException
  * @throws  RuntimeException
  */
 public function update()
 {
     // Assert the object is loaded.
     $this->assertIsLoaded();
     // Make sure the item is checked out.
     // $this->checkout();
     // Check for an alias.
     if (empty($this->alias)) {
         $this->alias = $this->title;
     }
     // Sanitize the alias.
     $this->alias = JFilterOutput::stringURLSafe($this->alias);
     // Update the last modified data for the content.
     $this->modified_date = JDate::getInstance();
     $this->modified_user_id = !$this->user->get('guest') ? (int) $this->user->get('content_id') : null;
     // Update the revision number.
     if (!$this->isTemporary()) {
         $this->revision += 1;
     }
     // Check the content object.
     $this->validate();
     // Trigger the before update event.
     $this->app->triggerEvent('onContentBeforeUpdate', array($this));
     // Perform the actual database updates.
     $this->doUpdate();
     // Trigger the after update event.
     $this->app->triggerEvent('onContentAfterUpdate', array($this));
     return $this;
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:38,代码来源:content.php

示例2: getForm

 /**
  * Gets a content form.
  *
  * @param   string  $type  The content type.
  *
  * @return  JForm  The form object.
  *
  * @since   12.1
  * @throws  RuntimeException
  */
 public function getForm($type)
 {
     // Get the form name.
     $name = 'JContent' . $type;
     try {
         // Get the base form.
         $form = JForm::getInstance($name, 'content', array('control' => 'jform'));
         // Load the type form.
         $form->loadFile($type, false, false);
         // Trigger the form preparation event.
         $this->app->triggerEvent('onContentPrepareForm', array($form));
     } catch (Exception $error) {
         throw new RuntimeException($error->getMessage(), $error->getCode(), $error);
     }
     return $form;
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:26,代码来源:factory.php


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