createPages (function)

Last updated: Sat, Apr 15, 2023 6:57 pm
Return to Knowledgebase

Purpose

Adds a page to the Database

Location

users/helpers/permissions.php

Parameters

# Parameter Data Type Required Description
1 $pages array Yes The function iterates over the array of page URLs and inserts each page into the pages table in the database.

Returns

Data Type Description of Returned Data
nothing

Example

createPages(['page1.php','page2.php');

Further Documentation:

The createPages function takes an array of page URLs as its parameter. The function iterates over the array of page URLs and inserts each page into the pages table in the database. The private field of each new page is set to the default value specified in the page_default_private setting in the settings table.

Here is an example of how the createPages function can be used:


$pageUrls = array(
'dashboard',
'profile',
'contact'
);

createPages($pageUrls);


In this example, an array of page URLs is defined with three pages. The createPages function is then called with the array of page URLs as its parameter. This will insert the pages into the pages table in the database, making them accessible on the website with default private setting as specified in the settings table.