AjaxResult class

AjaxResult class is used for return object from every server function called from JavaScript. Every server functions from plugins and every PHP code in actions should return object of this class.

Here are main properties of this class:


class AjaxResult {

  /*!
  * @attribute status
  * @brief Status of response. Can be true or false.Attribute status presents status of every call in application. Whenever is error in application request, status should be set to false.
  */
  public $status;

  /*!
  * @attribute message
  * @brief Message from server. We use attribute message to send successful text message from server to application that will be shown to user.
  */
  public $message;

  /*!
  * @attribute error
  * @brief Message about error. We use attribute error send text error message to application that will be shown to user in case result->status is false.
  */
  public $error;

  /*!
  * @attribute data
  * @brief Other data. Attribute data can be used to return entity data that will be used in application, HTML that will be shown as content in application or external URL.
  */
  public $data;

  /*!
  * @attribute returnActionType
  * @brief Type of return action. Attribute returnActionType tells application what to do after request is completed. This attribute can be set to showData, redirect or null. showData value of this attribute tells application to show HTML for page, top navigation and left navigation that is located in attributes data, topNavigation and leftNavigation. redirect value of this attribute tells application to redirect to external URL that is located in data attribute of result.
  */
  public $returnActionType;

  /*!
  * @attribute validationMessages
  * @brief Messages and components for false validation. Attribute validationMessages can be used to send error validation messages for components (check out tutorial <a href="https://www.izzedoappbuild.com/knowledgebase/how-to-validate-with-php-code/">How to validate with PHP code</a>).
  */
  public $validationMessages;

  /*!
  * @attribute topNavigation
  * @brief Definition of topNavigation. In attribute topNavigation is placed HTML for top navigation in application.
  */
  public $topNavigation;

  /*!
  * @attribute leftNavigation
  * @brief Definition of leftNavigation. In attribute leftNavigation is placed HTML for left navigation in application.
  */
  public $leftNavigation;

  /*!
  * @attribute developerNavigation
  * @brief Definition of developerNavigation. In attribute developerNavigation is placed HTML for developer navigation in developer panel.
  */
  public $developerNavigation;

  /*!
  * @attribute messageTitle
  * @brief Definition of messageTitle. We use attribute message to send text message title to application that will be shown to user. If this attribute is empty, message title will be Success.
  */
  public $messageTitle;

}