# Portal v2

#### Theme documentation

---

[https://adminlte.io/docs/3.2/](https://adminlte.io/docs/3.2/)

[https://github.com/ColorlibHQ/AdminLTE](https://github.com/ColorlibHQ/AdminLTE)

[https://adminlte.io/themes/v3/](https://adminlte.io/themes/v3/)

#### Webservice REST

---

**Handler**: include/Webservices/CustomerPortal.php

**Headers:**  
• Authorization: Basic base64\_encode("username:accesskey")  
• Portal-Session-Id: the parameter is optional and is returned by the "portal.login". Use in subsequent calls to optimize portal performance.  
• Content-Type: application/json

<table border="1" cellpadding="0" cellspacing="0" id="bkmrk-nome-handler-metodo-" style="width: 100%;"><tbody><tr><th class="align-left" style="width: 9.38277%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Name</span></span>**</th><th class="align-left" style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Parameters</span></span>**</th><th class="align-left" style="width: 15.2469%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</th></tr><tr><td style="width: 9.38277%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">portal.info</span></span></td><td style="width: 8.08637%;"> </td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain information on the license and logos used by the connected vtenext installation.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.login</td><td style="width: 8.08637%;"><div><div>**Body**</div><div>. username: string (*)</div><div>. password: string (*)</div><div>. language: string</div></div></td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to log in to the customer portal by providing the email (username) and password of the contact. The service also returns the accesskey and session id values to be used in subsequent calls as headers (Authorization and Portal-Session-Id).</span></span></td></tr><tr><td style="width: 9.38277%;">portal.logout</td><td style="width: 8.08637%;">**Headers**

. Authorization

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to logout the contact from the portal.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.send\_mail\_for\_password</td><td style="width: 8.08637%;"><div><div>**Body**</div><div>. email: string (*)</div><div>. language: string</div></div></td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to recover the password of a contact.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.modules\_list</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

<div><div>**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**</div><div>. language: string (*)</div></div></td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain a list of modules enabled for the contact's profile.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.get\_list</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

. module: string (\*)

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. language: string</span></span>

. folderid: int  
. search: array

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain the list of records of a module filtered by the contact profile.   
  
</span><span style="vertical-align: inherit;">The "folderid" parameter is used by the Documents module to get the documents of a specific folder.  
  
</span></span>The "search" parameter allows the paging of the list on the server-side.

Ex.

\[  
 'length' =&gt; 50, // Number of records to return  
 'start' =&gt; 0, // Paging offset  
 'search' =&gt; '', // Global search  
 'search\_columns' =&gt; \[ // Search by columns  
 \[  
 'index' =&gt; 0, // Index of the field  
 'column' =&gt; '', // Name of the field

 'search' =&gt; '', // Value of the field  
 \]

 \],  
 'ordering' =&gt; \[ // Ordering  
 \[

 'index' =&gt; 0, // Index of the field  
 'column' =&gt; '', // Name of the field

 'dir' =&gt; '', // asc/desc  
 \]

 \],  
\]

Note:  
1\. All searches are performed ONLY on the columns of the list.  
2\. Column search is performed in "LIKE" mode.  
3\. Sorting can only be done on one column.

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">  
</span></span></td></tr><tr><td style="width: 9.38277%;">portal.get\_blocks</td><td style="width: 8.08637%;">**Headers**

. Authorization

**Body**

. module: string (\*)

. language: string

. mode: string (edit, create, detail, list) (\*)  
. app\_data: array

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain the list of the blocks and the related fields of a module filtered by the contact profile.  
  
The "app\_data" parameter represents the record being edited (array with field name and value) and is used by the SDK views to establish the visibility of the fields.  
This parameter will also be used in the future for managing conditional fields.  
</span></span></td></tr><tr><td style="width: 9.38277%;">portal.get\_record</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. module: string (\*)</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">If the contact has visibility permissions for the indicated record, it allows you to obtain its data.</span></span>

</td></tr><tr><td style="width: 9.38277%;">portal.save\_record</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. module: string (\*)</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

. values: encoded (\*)

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">If the contact has write permissions for the indicated record, it allows its saving.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.delete\_record</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. module: string (\*)</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">If the contact has delete permissions for the indicated record, it allows its deletion.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.write\_ticket\_comment</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

. comment: string (\*)

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to write a comment within the indicated ticket.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.get\_attachments</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain the list of documents of the specified record filtered by the visibility of the contact profile.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.download\_attachment</td><td style="width: 8.08637%;">**Headers**

. Authorization

**Body**

. relid: int (\*)

. docid: int

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">If the contact has permission to view the attachment (relid), it allows its download.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.upload\_attachment</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. relid: int (\*)</span></span>

. title: string (\*)  
**File**

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows the uploading of an attachment related to the specified record (relid). </span><span style="vertical-align: inherit;">You can indicate the name (title) of the document that will be generated.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.provide\_confidential\_info</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. </span><span style="vertical-align: inherit;">id: int (\*)</span></span>

. comments: string

. data: string (\*)

. request\_commentid: int (\*)

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to respond to a request for confidential information. </span><span style="vertical-align: inherit;">The "id" parameter indicates the ticket id, the "comments" parameter indicates the unencrypted comment, the "data" parameter indicates the confidential response, and the "request\_commentid" parameter indicates the id of the comment to which the confidential response should be provided .</span></span></td></tr><tr><td style="width: 9.38277%;">portal.get\_home\_widgets</td><td style="width: 8.08637%;">**Headers**

. Authorization

**Body**

. language: string

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain the widgets configured in the profile associated with the contact.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.save\_authenticate\_cookie</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

. contactid: int (\*)

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Provides an hash to be stored in a cookie to remember the contact's login.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.check\_authenticate\_cookie</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. contactid: int (\*)</span></span>

. hash: string (\*)

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to verify the hash used to remember the contact's login.</span></span></td></tr><tr><td style="width: 9.38277%;">portal.change\_password</td><td style="width: 8.08637%;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Headers</span></span>**

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">. Authorization</span></span>

**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Body</span></span>**

. username: string (\*)

. old\_password: string (\*)

. password: string (\*)

. language: string

</td><td style="width: 15.2469%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to change the contact's password.</span></span></td></tr></tbody></table>

##### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Register a new REST webservice</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Create a new file and execute it (e.g. plugins/script/script.php).</span></span>

```PHP
<?php
require('../../config.inc.php');
chdir($root_directory);
require_once('include/utils/utils.php');
require_once('vtlib/Vtecrm/Module.php');
$Vtiger_Utils_Log = true;
global $adb, $table_prefix;
VteSession::start();

SDK::setClass('CustomerPortalRestApi', 'CustomerPortalRestApi2', 'modules/SDK/src/CustomerPortalRestApi2.php');

$parameters = ['param1' => 'string', 'param2' => 'encoded', 'param3' => 'encoded'];
$perm = 'read'; // read, write, readwrite
SDK::setRestOperation('portal.foo', 'modules/SDK/src/CustomerPortalRestApi2.php', 'CustomerPortalRestApi2.foo', $parameters, $perm);

```

Create a new file that contains the CustomerPortalRestApi2 class <span style="vertical-align: inherit;">(e.g. modules/SDK/src/CustomerPortalRestApi2.php).</span>

```PHP
<?php

require_once('include/Webservices/CustomerPortal.php');

class CustomerPortalRestApi2 extends CustomerPortalRestApi {

	public function foo($param1, $param2, $param3) {
		$data = [1, 2, 3, 4, 5];
        // ...
		return $data;
	}

}
```

##### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Extend an existing REST webservice</span></span>

<span style="vertical-align: inherit;">Create a new file and execute it (e.g. plugins/script/script.php).</span>

```PHP
<?php
require('../../config.inc.php');
chdir($root_directory);
require_once('include/utils/utils.php');
require_once('vtlib/Vtecrm/Module.php');
$Vtiger_Utils_Log = true;
global $adb, $table_prefix;
VteSession::start();

SDK::setClass('CustomerPortalRestApi', 'CustomerPortalRestApi2', 'modules/SDK/src/CustomerPortalRestApi2.php');
```

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Create a new file that contains the CustomerPortalRestApi2 class​ (e.g. modules/SDK/src/CustomerPortalRestApi2.php).</span></span>

```PHP
<?php

require_once('include/Webservices/CustomerPortal.php');

class CustomerPortalRestApi2 extends CustomerPortalRestApi {

	public function get_list($module, $language, $folderid = 0, $search = []) {
		$ret = parent::get_list($module, $language, $folderid, $search);
		// your code here ...
		return $ret;
	}

}
```

#### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Structure of main folders/files</span></span>

---

<p class="callout info"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The portal folder is located at: </span></span>**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">VTE\_ROOT/portal/v2</span></span>**</p>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The main folders/files of the new portal are:</span></span>

<table border="1" id="bkmrk-nome-cartella-descri" style="border-collapse: collapse; width: 100%; height: 469px;"><tbody><tr style="height: 29px;"><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Folder/file name</span></span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">app</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the files and the logic of the portal.</span></span></td></tr><tr style="height: 46px;"><td style="width: 50%; height: 46px;">app/controllers</td><td style="width: 50%; height: 46px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the files that manage the portal's default actions (e.g. Login, Logout, Edit, Detail, etc.).</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">app/fields</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the files that manage the portal module fields.</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">app/modules</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains custom logic of some vtenext modules (e.g. Documents, Processes, HelpDesk, etc.).</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">app/PortalModule.php</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Class that manages the actions of the portal modules (e.g. Create, Detail, Edit, etc.). </span><span style="vertical-align: inherit;">The class can be extended to change the default behaviors of a module.</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">config</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the portal configuration files.</span></span></td></tr><tr style="height: 46px;"><td style="width: 50%; height: 46px;">public</td><td style="width: 50%; height: 46px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the portal's public files (e.g. index.php, css, javascript, images, etc.).</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">resources</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the resources used by the portal such as translation files (lang) and templates (templates).</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">sdk</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The folder is used to insert new customizations for the customer.</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">storage</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains temporary files (e.g. cache, logs, etc.).</span></span></td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">vendor</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Contains the external libraries used by the portal.</span></span></td></tr></tbody></table>

#### Request lifecycle

---

<div drawio-diagram="4959"><img src="https://usermanual.vtenext.com/uploads/images/drawio/2023-09/drawing-6-1694591374.png" alt=""/></div>


#### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Portal configuration</span></span>

---

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The portal configuration file is located in "config/portal.config.php".</span></span>

<p class="callout danger"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">To </span></span>**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">overwrite the parameters</span></span>**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;"> the "config/sdk.config.php" file must be used otherwise, in case of updating the version of vtenext, the changes could be lost.</span></span></p>

<p class="callout danger"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">**How to move the Business Portal to another host/folder**  
Update the "portal\_url", "vte\_url" and "csrf\_secret" parameters in the "config/sdk.config.php" file.  
Also change the "default\_timezone" parameter if the host has a different timezone from the one in which the vte is located. Change the "portal.url" prop to the link pointing to the v2 folder. e.g. https://ticket.vtenext.com/v2​​</span></span></p>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Here is the list of parameters supported by the new portal:</span></span>

<table border="1" id="bkmrk-parametro-tipo-defau" style="border-collapse: collapse; width: 100%; height: 1403px;"><tbody><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Parameter</span></span>**</td><td style="width: 10.9258%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Type</span></span>**</td><td style="width: 18.7039%; height: 29px;">**Default**</td><td style="width: 47.716%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 80px;"><td style="width: 22.6544%; height: 80px;">portal\_url</td><td style="width: 10.9258%; height: 80px;">String</td><td style="width: 18.7039%; height: 80px;">$PORTAL\_URL  
(config.inc.php)</td><td style="width: 47.716%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the URL of the customer portal. </span><span style="vertical-align: inherit;">If the portal folder is inside the vtenext root directory, the variable will be set to the value of the $PORTAL\_URL variable set in the config.inc.php file.</span></span></td></tr><tr style="height: 96px;"><td style="width: 22.6544%; height: 96px;">vte\_url</td><td style="width: 10.9258%; height: 96px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 96px;">$site\_URL (config.inc.php)</td><td style="width: 47.716%; height: 96px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the URL of vtenext and is used to obtain its data via the rest API. </span><span style="vertical-align: inherit;">If the portal folder is inside the vtenext root directory, the variable will be set to the value of the $site\_URL variable set in the config.inc.php file.</span></span></td></tr><tr style="height: 63px;"><td style="width: 22.6544%; height: 63px;"><div><div>default_language</div></div></td><td style="width: 10.9258%; height: 63px;">String</td><td style="width: 18.7039%; height: 63px;"><div><div>it_it</div></div></td><td style="width: 47.716%; height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the default language used in the customer portal. </span><span style="vertical-align: inherit;">The value can be replaced with a supported language (see "languages" parameter).</span></span></td></tr><tr style="height: 63px;"><td style="width: 22.6544%; height: 63px;"><div><div>languages</div></div></td><td style="width: 10.9258%; height: 63px;">Array</td><td style="width: 18.7039%; height: 63px;"><div><div>['en_us' =&gt; 'US English', 'it_it' =&gt; 'IT Italiano']</div></div></td><td style="width: 47.716%; height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the languages ​​supported in the customer portal. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">To add a new language you need to create a new file in the resources/lang folder.</span></span></td></tr><tr style="height: 113px;"><td style="width: 22.6544%; height: 113px;"><div><div>production</div></div></td><td style="width: 10.9258%; height: 113px;">Bool</td><td style="width: 18.7039%; height: 113px;">false</td><td style="width: 47.716%; height: 113px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">This configuration indicates whether errors should be displayed or not. </span><span style="vertical-align: inherit;">If the environment is production, the value will be set to true to disable error display. </span><span style="vertical-align: inherit;">If the environment is development, the value will be set to false to allow errors to appear.</span></span></td></tr><tr style="height: 80px;"><td style="width: 22.6544%; height: 80px;"><div><div>default_module</div></div></td><td style="width: 10.9258%; height: 80px;">String</td><td style="width: 18.7039%; height: 80px;"> </td><td style="width: 47.716%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the default module to load after logging into the portal. </span><span style="vertical-align: inherit;">The value can be replaced with the name of the desired module (must be enabled from profile). </span><span style="vertical-align: inherit;">If the parameter is empty, the portal home will be loaded.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>favicon</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div>assets/img/VTENEXT_favicon.ico</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the path of the favicon. </span><span style="vertical-align: inherit;">The value is relative to the public folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>login_logo</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div>assets/img/VTENEXT_login.png</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the path of the logo to load on the login page. </span><span style="vertical-align: inherit;">The value is relative to the public folder.</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[UPDATE\] The logo must be loaded in vtenext settings &gt; Logos.</span></span>

</td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>login_background</div></div></td><td style="width: 10.9258%; height: 29px;">String</td><td style="width: 18.7039%; height: 29px;"> </td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the path of the background to load on the login page. </span><span style="vertical-align: inherit;">The value is relative to the public folder.</span></span></td></tr><tr style="height: 96px;"><td style="width: 22.6544%; height: 96px;"><div><div>header_logo_sm</div></div></td><td style="width: 10.9258%; height: 96px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 96px;"><div><div>assets/img/VTENEXT_toggle.png</div></div></td><td style="width: 47.716%; height: 96px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the path of the icon to load in the minimized sidebar. </span><span style="vertical-align: inherit;">The value is relative to the public folder. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[UPDATE\] The icon must be loaded in vtenext settings &gt; Logos.</span></span></td></tr><tr style="height: 80px;"><td style="width: 22.6544%; height: 80px;"><div><div>header_logo_lg</div></div></td><td style="width: 10.9258%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 80px;"><div><div>assets/img/VTENEXT_header.png</div></div></td><td style="width: 47.716%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the path of the icon to load in the expanded sidebar. </span><span style="vertical-align: inherit;">The value is relative to the public folder. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[UPDATE\] The icon must be loaded in vtenext settings &gt; Logos.</span></span></td></tr><tr style="height: 63px;"><td style="width: 22.6544%; height: 63px;"><div><div>helpdesk_logo</div></div></td><td style="width: 10.9258%; height: 63px;">String</td><td style="width: 18.7039%; height: 63px;"><div><div>assets/img/helpdesk.png</div></div></td><td style="width: 47.716%; height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the logo used to display the response given by customer support. </span><span style="vertical-align: inherit;">The value is relative to the public folder.</span></span></td></tr><tr style="height: 80px;"><td style="width: 22.6544%; height: 80px;"><div><div>sidebar_theme</div></div></td><td style="width: 10.9258%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 80px;"><div><div>sidebar-dark-primary</div></div></td><td style="width: 47.716%; height: 80px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the class of the main sidebar. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">It can have a "dark" or "light" brightness. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">It can also have a color variant, such as "primary", "success", "warning", "info", "danger".</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>enable_sidebar_search</div></div></td><td style="width: 10.9258%; height: 29px;">Bool</td><td style="width: 18.7039%; height: 29px;"><div><div>false</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Enable/disable the search bar in the main sidebar.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>csrf_secret</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div>$csrf_secret (config.inc.php)</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the secret key used to generate a csrf token. </span><span style="vertical-align: inherit;">If the portal folder is inside the vtenext root directory, the variable will be set to the value of the $csrf\_secret variable set in the config.inc.php file.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">upload\_dir</span></span></div></div></td><td style="width: 10.9258%; height: 29px;">String</td><td style="width: 18.7039%; height: 29px;"> </td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the name of the folder used for uploading files.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>browser_title_prefix</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"> </td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the prefix label to use for the browser title. </span><span style="vertical-align: inherit;">The value can be replaced with the desired label.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>browser_title_suffix</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div>customer_portal</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the suffix label to use for the browser title. </span><span style="vertical-align: inherit;">The value can be replaced with the desired label.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>remember_cookie_name</div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">String</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div>portal_login_hash</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the name of the cookie used to remember user authentication.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>login_expire_time</div></div></td><td style="width: 10.9258%; height: 29px;">Int</td><td style="width: 18.7039%; height: 29px;"><div><div>2592000 (one month)</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the expiration of the cookie used to remember user authentication. </span><span style="vertical-align: inherit;">The value can be replaced with the desired number of seconds.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div>default_timezone</div></div></td><td style="width: 10.9258%; height: 29px;">String</td><td style="width: 18.7039%; height: 29px;"><div><div>Europe/Rome</div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the default time zone used in the customer portal. </span><span style="vertical-align: inherit;">This configuration must be the same as the $default\_timezone variable set in the vtenext config.inc.php file.</span></span></td></tr><tr style="height: 96px;"><td style="width: 22.6544%; height: 96px;"><div><div><div><div>module_icons</div></div></div></div></td><td style="width: 10.9258%; height: 96px;">Array</td><td style="width: 18.7039%; height: 96px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 96px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can override the default icons used for modules enabled in the customer portal. </span><span style="vertical-align: inherit;">The default form icons are found in app/layouts/PortalLayout.php. </span><span style="vertical-align: inherit;">The names of the icons can be found here https://fonts.google.com/icons.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><div><div>sdk_languages</div></div></div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add new labels or modify existing ones. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the sdk folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><div><div>sdk_global_php</div></div></div></div></td><td style="width: 10.9258%; height: 29px;">Array</td><td style="width: 18.7039%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add php files to load on each page (they should contain classes/functions). </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the sdk folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><div><div>sdk_global_js</div></div></div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add js to load globally. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the public/assets/sdk folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><div><div>sdk_module_js</div></div></div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add js to load for a specific module. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the public/assets/sdk folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 22.6544%; height: 29px;"><div><div><div><div>sdk_global_css</div></div></div></div></td><td style="width: 10.9258%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add css to load globally. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the public/assets/sdk folder.</span></span></td></tr><tr><td style="width: 22.6544%;"><div><div><div><div><div><div>sdk_controllers</div></div></div></div></div></div></td><td style="width: 10.9258%;">Array</td><td style="width: 18.7039%;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add custom actions ("action" field in the URL). </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The array represents an association between the action name and the file that contains the controller class to handle the request. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the sdk folder.</span></span></td></tr><tr><td style="width: 22.6544%;"><div><div><div><div><div><div>sdk_module</div></div></div></div></div></div></td><td style="width: 10.9258%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add customizations on a specific module. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">The array represents an association between the module name and the file that contains the module's extended class. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the sdk folder.</span></span></td></tr><tr><td style="width: 22.6544%;"><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">sdk\_menu</span></span></div></div></div></div></div></div></td><td style="width: 10.9258%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Array</span></span></td><td style="width: 18.7039%;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">\[\]</span></span></div></div></td><td style="width: 47.716%;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">With this configuration you can add custom menu items in the sidebar. </span></span>  
<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">You need to create a new file in the sdk folder.</span></span></td></tr></tbody></table>

#### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">API Reference - Main classes, methods, functions and variables</span></span>

---

##### \\app\\Request

<table border="1" id="bkmrk-metodo-descrizione" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Arguments</span></span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>get()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$keys = null, $purify = false</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get one or more parameters from the global variable $\_GET. </span><span style="vertical-align: inherit;">If the second argument is set to "true", the parameters are purified through the HTML Purifier library. </span><span style="vertical-align: inherit;">Example:</span></span>

```PHP
$request->get('foo');
$request->get(['foo', 'bar']);
$request->get('foo', true);
```

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div>post()</div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$keys = null, $purify = false</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get one or more parameters from the global variable $\_POST. </span><span style="vertical-align: inherit;">If the second argument is set to "true", the parameters are purified through the HTML Purifier library. </span><span style="vertical-align: inherit;">Example:</span></span>

```PHP
$request->post('foo');
$request->post(['foo', 'bar']);
$request->post('foo', true);
```

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>files()</div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div>$key</div></div></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get files uploaded via the HTTP POST method and organized via the global variable $\_FILES.</span></span>

```PHP
$request->files('attachments');
```

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div>cookie()</div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div>$keys = null, $purify = false</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to obtain one or more parameters from the global variable $\_COOKIE. </span><span style="vertical-align: inherit;">If the second argument is set to "true", the parameters are purified through the HTML Purifier library. </span><span style="vertical-align: inherit;">Example:</span></span>

```PHP
$request->cookie('foo');
```

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div>server()</div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$keys = null, $purify = false</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get one or more parameters from the global variable $\_SERVER. </span><span style="vertical-align: inherit;">If the second argument is set to "true", the parameters are purified through the HTML Purifier library. </span><span style="vertical-align: inherit;">Example:</span></span>

```PHP
$request->server('');
```

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>isGet()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns true if the request method is GET.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">isPost()</span></span></div></div></td><td style="width: 25%; height: 29px;"> </td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns true if the request method is POST.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>isAjax()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns true if the request is AJAX.​</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>purify()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div>$input</div></div></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Purify the $input variable through the HTML Purifier library.</span></span></td></tr></tbody></table>

##### \\app\\Response

<table border="1" id="bkmrk-metodo-argomenti-des" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>__construct()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$content = '', $statusCode = 200, $headers = []</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Initializes a new \\app\\Response() object with the response content ($content), return code ($statusCode), and default headers ($headers).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>setContent()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$content</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the content of the response.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">setStatusCode()</span></span></div></div></td><td style="width: 25%; height: 29px;"><div><div>$statusCode</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the response return code.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>setHeader()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$header, $replace = true</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set a new header in the response. </span><span style="vertical-align: inherit;">With the second argument it is possible to indicate whether or not the header must replace a previous header already set.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>setMimeType()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$mimeType = 'text/html'</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Sets the response content mime.</span></span>

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>json()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$data</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set response content with $data converted to JSON format and 'application/json' mime.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>redirect()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$page</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Performs a redirect to $page.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>downloadFile()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$fullpath</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows downloading of a file located in $fullpath.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>output()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Outputs the content, response code, and headers you set.</span></span></td></tr></tbody></table>

##### \\app\\Session

<table border="1" id="bkmrk-metodo-argomenti-des-0" style="border-collapse: collapse; width: 100%; height: 261px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>set()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$key, $value = ''</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the value $value with key $key in $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>get()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$key</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get the value with key $key from $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>flash()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key</span></span></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get the value with key $key from $\_SESSION. </span><span style="vertical-align: inherit;">Next, the $key will be deleted from $\_SESSION.​</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>remove()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key</span></span></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Delete the $key from $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>hasKey()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key</span></span></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns true if $key exists in $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">setMulti()</span></span></div></div></td><td style="width: 25%; height: 29px;">$keys</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to write multiple values ​​to $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>removeMulti()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$keys</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Delete multiple values ​​in $\_SESSION.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>append()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key, $value = ''</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the $key as an array in $\_SESSION and the value $value is added to it.</span></span></td></tr></tbody></table>

##### \\app\\Config

<table border="1" id="bkmrk-metodo-argomenti-des-1" style="border-collapse: collapse; width: 100%; height: 261px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>has()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns true if $key exists in the global configuration.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">get()</span></span></div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$key</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get the value with key $key from the global configuration.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>set()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$key, $value</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the value $value with key $key in the global configuration.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>getAll()</div></div></td><td style="width: 25%; height: 29px;"> </td><td><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">It allows you to obtain a key-value list with all the global configuration.</span></span></td></tr><tr><td style="width: 25%;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">setMulti()</span></span></div></div></td><td style="width: 25%;"><div><div>$values</div></div></td><td><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to write multiple values ​​into the global configuration.</span></span></td></tr><tr><td style="width: 25%;"><div><div><div><div>clear()</div></div></div></div></td><td style="width: 25%;"><div><div><div><div>$key</div></div></div></div></td><td><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Delete the $key from the global configuration.</span></span></td></tr><tr><td style="width: 25%;"><div><div><div><div><div><div>clearAll()</div></div></div></div></div></div></td><td style="width: 25%;"> </td><td><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Delete all values ​​from the global configuration.</span></span></td></tr></tbody></table>

##### \\app\\PortalModule

<table border="1" id="bkmrk-variabile-default-de" style="border-collapse: collapse; width: 100%; height: 307px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Variable</span></span>**</td><td style="width: 25%; height: 29px;">**Default**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;">$hasComments</td><td style="width: 25%; height: 29px;"><div><div>false</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates whether the module supports comments.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>$hasAttachments</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">false</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates whether the module supports attachments.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>$enableEdit</div></div></td><td style="width: 25%; height: 29px;"><div><div>true</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates whether the module can be modified (edit mode).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>$formColumns</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">3</span></span></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the number of columns to use for displaying fields in Create, Edit and Detail.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>$listTemplate</div></div></td><td style="width: 25%; height: 29px;"><div><div>List.tpl</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the template used for displaying a list (action List).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;">$referenceListTemplate</td><td style="width: 25%; height: 29px;"><div><div>sections/ReferenceList.tpl</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the template used for displaying a related list (uitype 10).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>$detailTemplate</div></div></td><td style="width: 25%; height: 29px;"><div><div>Detail.tpl</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the template used to display the detail of a record (action Detail).</span></span></td></tr><tr style="height: 46px;"><td style="width: 25%; height: 46px;"><div><div><div><div>$editTemplate</div></div></div></div></td><td style="width: 25%; height: 46px;"><div><div><div><div>Edit.tpl</div></div></div></div></td><td style="height: 46px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the template used to display the edit of a record (action Edit).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>$notAuthorizedTemplate</div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>PageNotAuthorized.tpl</div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Indicates the template used to display a permission error (e.g. record not found or permission errors).</span></span></td></tr></tbody></table>

<table border="1" id="bkmrk-metodo-argomenti-des-2" style="width: 100%; border-collapse: collapse; height: 353px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>__construct()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$module</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$module indicates the name of the module to obtain an instance of the class. </span><span style="vertical-align: inherit;">If the module has been extended via SDK then an instance of the extended class will be returned.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>prepareList()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$viewer, $request</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method used for displaying a list (action List).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>postProcessList()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$viewer, $request</span></span></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">This method can be used by extended classes to insert/modify data set in prepareList().</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>prepareEdit()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$viewer, $request</span></span></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method used to display the edit of a record (action Edit).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>postProcessEdit()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$viewer, $request</span></span></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">This method can be used by extended classes to insert/modify the data set in prepareEdit().</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>prepareDetail()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$viewer, $request</span></span></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method used to display the detail of a record (action Detail).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>postProcessDetail()</div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$viewer, $request</span></span></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">This method can be used by extended classes to insert/modify data set in prepareDetail().</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>saveRecord()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$request</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method used to save a record (action Save).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>postProcessSaveValues()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$request, &amp;$values</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">This method can be used by extended classes to insert/modify data set in saveRecord().</span></span></td></tr><tr style="height: 63px;"><td style="width: 25%; height: 63px;"><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">isPermitted()</span></span></div></div></div></div></td><td style="width: 25%; height: 63px;"><div><div><div><div>$module, $action = self::ACTION_LIST, $recordValues = []</div></div></div></div></td><td style="height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns if the contact has permission to perform a certain action.</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">List of supported actions:</span></span>

<div><div>. ACTION_LIST</div><div>. ACTION_CREATE</div><div>. ACTION_EDIT</div><div>. ACTION_DETAIL</div><div>. ACTION_DELETE</div><div>. ACTION_SAVE</div><div>. ACTION_ADD_COMMENTS</div><div>. ACTION_UPLOAD_ATTACHMENTS</div><div>. ACTION_CHANGE_PWD</div><div>. ACTION_SOLVE_TICKET</div></div></td></tr></tbody></table>

##### \\app\\clients\\PortalRestClient

<table border="1" id="bkmrk-metodo-argomenti-des-3" style="border-collapse: collapse; width: 100%; height: 266px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Method</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>get()</div></div></td><td style="width: 25%; height: 29px;">$restName, $queryParameters = \[\], $headers = \[\]</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to perform a GET request to vtenext.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>post()</div></div></td><td style="width: 25%; height: 29px;">$restName, $queryParameters = \[\], $bodyParameters = \[\], $headers = \[\]</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to perform a POST request to vtenext.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">postMultipart()</span></span></div></div></td><td style="width: 25%; height: 29px;">$restName, $queryParameters = \[\], $bodyParameters = \[\], $fileParameters = \[\], $headers = \[\]</td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to perform a multipart POST request to vtenext.</span></span>

</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>patch()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$restName, $queryParameters = [], $bodyParameters = [], $headers = []</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to execute a PATCH request to vtenext.</span></span></td></tr><tr style="height: 63px;"><td style="width: 25%; height: 63px;"><div><div>delete()</div></div></td><td style="width: 25%; height: 63px;"><div><div>$restName, $queryParameters = [], $headers = []</div></div></td><td style="height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to execute a DELETE request to vtenext.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>postDownload()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$restName, $queryParameters = \[\], $bodyParameters = \[\], $headers = \[\]</span></span></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to perform a POST request to download a vtenext file in stream mode.</span></span></td></tr></tbody></table>

##### Helpers

<table border="1" id="bkmrk-funzione-argomenti-d" style="border-collapse: collapse; width: 100%; height: 1310px;"><tbody><tr style="height: 29px;"><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Function</span></span>**</td><td style="width: 25%; height: 29px;">**<span style="vertical-align: inherit;">Arguments</span>**</td><td style="width: 50%; height: 29px;">**<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Description</span></span>**</td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>preprint()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$var</span></span></div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">print\_r formatted with &lt;pre&gt; tag</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">predump()</span></span></div></div></td><td style="width: 25%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$var</span></span></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">var\_dump formatted with &lt;pre&gt; tags</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>encodeForHtml()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$value, $charset = 'UTF-8'</div></div></td><td style="width: 50%; height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Encode the $value value to be inserted into an HTML page.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>encodeForHtmlAttr()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$value, $enclosing = '"'</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Encode the $value value to be placed inside an HTML tag attribute.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>encodeForJs()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$value, $enclosing = '"'</span></span></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Encode the $value value to be placed inside a javascript &lt;script&gt;.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>htmlAttr()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$attributes</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Encode a list of attributes to be placed inside an HTML tag.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>config()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$key</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to get the value with key $key from the global configuration.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div>trans()</div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div>$key, $args = []</div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Translate the label $key.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>listUrl()</div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>$module, $extraParams = []</div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generate a link to open a list.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div>createUrl()</div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$module, $extraParams = \[\]</span></span></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to open the creation of a record.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div>createDocUrl()</div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div>$module, $folderId, $extraParams = []</div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to open the creation of a document.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div>detailUrl()</div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div>$module, $record, $extraParams = []</div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to open the detail of a record.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">editUrl()</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$module, $record, $extraParams = \[\]</span></span></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to open the editing of a record.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>downloadUrl()</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$record, $documentId, $extraParams = []</div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to download a document.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>docFolderUrl()</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$module, $folderId, $extraParams = \[\]</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generates a link to open a specific folder in the documents module.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>returnUrl()</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$request</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Generate a return link (e.g. "Cancel" action).</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>portalLanguage()</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the language used in the portal.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>setPortalLanguage()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$language</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set the $language in the portal.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div>getBrowserTitle()</div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$title</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the title to be set in an HTML page of the portal.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">getModuleLabel()</span></span></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$module</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the translation of the module $module.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">getSingleModuleLabel()</span></span></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$module</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the singular translation of the module $module.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div>getMaxUploadSize()</div></div></div></div></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the maximum upload size in the portal.</span></span></td></tr><tr style="height: 63px;"><td style="width: 25%; height: 63px;"><div><div>setPortalCookie()</div></div></td><td style="width: 25%; height: 63px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$name, $value = "", $expires_or_options, $httponly = false</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 63px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Set a cookie in the portal.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">unsetPortalCookie()</span></span></div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$name, $httponly = false</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Removes a cookie from the portal.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div>csrfToken()</div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the csrf token.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>csrfInputName()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the name of the input for sending the csrf token.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>flashPortalError()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$error</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to display a timed error message.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div>flashPortalMessage()</div></div></div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$message</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows you to display a timed message.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">customerId()</span></span></div></div></div></div></div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the ID of the authenticated contact.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>customerEmail()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the email of the authenticated contact.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>customerUsername()</div></div></td><td style="width: 25%; height: 29px;"> </td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the name and surname of the authenticated contact.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>resourcever()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$filename</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Allows the versioning of css and javascript files.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>basePath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$path = ''</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal base folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the base folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>appPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "app" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "app" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>configPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "config" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "config" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>resourcesPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$path = ''</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "resources" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "resources" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>langPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">only $</span></span></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the indicated language file $lang.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>storagePath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "storage" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "storage" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>publicPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "public" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "public" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>vtePath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the vtenext folder. </span><span style="vertical-align: inherit;">If $path is indicated, a path is created and returned starting from the vtenext folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>sdkPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>$path = ''</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "sdk" folder. </span><span style="vertical-align: inherit;">If $path is indicated, a path is created and returned starting from the "sdk" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>sdkAssetsPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">$path = ''</span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns the path to the portal's "public/assets/sdk" folder. </span><span style="vertical-align: inherit;">If $path is specified, a path is created and returned starting from the "public/assets/sdk" folder.</span></span></td></tr><tr style="height: 29px;"><td style="width: 25%; height: 29px;"><div><div>publicRelPath()</div></div></td><td style="width: 25%; height: 29px;"><div><div>$assetPath</div></div></td><td style="height: 29px;"><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Returns a relative path starting from the "public" folder.</span></span></td></tr></tbody></table>

#### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Examples</span></span>

---

##### SDK view

Here is an example of how to change the visibility of portal fields via view SDK.

```PHP
<?php
require('../../config.inc.php');
chdir($root_directory);
require_once('include/utils/utils.php');
require_once('vtlib/Vtecrm/Module.php');
$Vtiger_Utils_Log = true;
global $adb, $table_prefix;
VteSession::start();

$module = '';
$src = '';
$mode = 'constrain';
$success = 'continue';
SDK::addView($module, $src, $mode, $success);
```

```php
<?php

global $sdk_mode, $table_prefix;

switch ($sdk_mode) {
	case 'portal.create':
		$readonly = 100;
		$success = true;
		break;
	case 'portal.edit':
	case 'portal.detail':
		if ($col_fields['field3'] !== 'Open') {
			$readonly = 99;
			$success = true;
		}
		if (in_array($fieldname, ['field1', 'field2'])) {
			$readonly = 100;
			$success = true;
		}
		break;
}

```


##### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Creating a new controller</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Here is an example of how to create a new controller to manage a custom action.</span></span>

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Edit "config/sdk.config.php" to insert a new controller</span></span>

```PHP
return [
	'sdk_controllers' => [
		'SampleVte' => 'controllers/SampleVteController.php',
	]
];
```

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Implement the SampleVteController class in "sdk/controllers/SampleVteController.php"</span></span>

```PHP
<?php

class SampleVteController extends \app\controllers\BaseController {
	
	public function index($request) {
		return $this->displaySomething($request);
	}

	protected function displaySomething($request) {
		$parameter1 = $request->get('parameter1', true);
		$parameter2 = $request->get('parameter2', true);

		$this->viewer->assign('PARAMETER1', $parameter1);
		$this->viewer->assign('PARAMETER2', $parameter2);

		$layout = \app\LayoutFactory::getPortalLayout($this->viewer, $this->client, $request);
		$output = $this->fetchWithLayout('sdk/SampleVte.tpl', $layout);

		return new \app\Response($output);
	}
	
}

```

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Create a new template in "resources/templates/sdk/SampleVte.tpl"</span></span>

```PHP
{extends file='layouts/PortalLayout.tpl'}

{block name=content}
	<h1>Sample Vte</h1>
{/block}
```

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Modify "config/sdk.config.php" indicating the sdk file for inserting the new entries in the side menu</span></span>

```PHP
return [
	'sdk_controllers' => [
		'SampleVte' => 'controllers/SampleVteController.php',
	],
  	'sdk_menu' => [
		'samplevte-menu.php',
	]
];
```

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Edit the "sdk/samplevte-menu.php" file</span></span>

```PHP
<?php

return [
	[
		'text' => trans('SampleVte'),
		'active' => false,
		'prefix' => [
			'type' => 'icon',
			'icon_style' => 'material',
			'icon_name' => 'pie_chart',
		],
		'action' => [
			'type' => 'link',
			'link_href' => "index.php?action=SampleVte",
		],
	],
];

```

[![image-1694533951130.48.16.png](https://usermanual.vtenext.com/uploads/images/gallery/2023-09/scaled-1680-/image-1694533951130-48-16.png)](https://usermanual.vtenext.com/uploads/images/gallery/2023-09/image-1694533951130-48-16.png)

##### <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Extending a module</span></span>

<span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Here is an example of how to extend the functionality of a module.</span></span>

- <span style="vertical-align: inherit;">Edit</span> "config/sdk.config.php"

```PHP
return [
	'sdk_module' => [
		'Contacts' => 'modules/ContactsModule.php',
	]
];
```

- <span style="vertical-align: inherit;"><span style="vertical-align: inherit;">Implement the ContactsModule class in "sdk/modules/ContactsModule.php"</span></span>

```PHP
<?php

class ContactsModule extends \app\PortalModule {
	
	public $hasComments = true;

	public $formColumns = 2;

	public function canAddComments() {
		return true;
	}
	
}

```

[![image-1694596916198.20.03.png](https://usermanual.vtenext.com/uploads/images/gallery/2023-09/scaled-1680-/image-1694596916198-20-03.png)](https://usermanual.vtenext.com/uploads/images/gallery/2023-09/image-1694596916198-20-03.png)