PHPackages                             apharmony/jsharmony-cms-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. apharmony/jsharmony-cms-sdk-php

ActiveLibrary[API Development](/categories/api)

apharmony/jsharmony-cms-sdk-php
===============================

jsHarmony CMS SDK for PHP

1.4.1(4y ago)023LGPL-3.0PHPPHP &gt;=7.1

Since Aug 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/apHarmony/jsharmony-cms-sdk-php)[ Packagist](https://packagist.org/packages/apharmony/jsharmony-cms-sdk-php)[ RSS](/packages/apharmony-jsharmony-cms-sdk-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (9)Used By (0)

jsharmony-cms-sdk-php
=====================

[](#jsharmony-cms-sdk-php)

jsHarmony CMS SDK for PHP

Installation
------------

[](#installation)

Installation and integration instructions are available at [jsHarmonyCMS.com](https://www.jsharmonycms.com/resources/integrations/php/)

API Documentation
-----------------

[](#api-documentation)

### *apHarmony\\jsHarmonyCms\\CmsRouter Class*

[](#apharmonyjsharmonycmscmsrouter-class)

- [Constructor](#cmsrouter-constructor)
- *Public Properties*
    - [config](#cmsrouter-config)
- *Public Methods*
    - [serve](#cmsrouter-serve)
    - [getStandalone](#cmsrouter-getstandalone)
    - [getPlaceholder](#cmsrouter-getplaceholder)
    - [isInEditor](#cmsrouter-isineditor)
    - [resolve](#cmsrouter-resolve)
    - [route](#cmsrouter-route)
    - [matchRedirect](#cmsrouter-matchredirect)
    - [getRedirectData](#cmsrouter-getredirectdata)
    - [getEditorScript](#cmsrouter-geteditorscript)
    - [serveFile](#cmsrouter-servefile)
    - [redirect301](#cmsrouter-redirect301)
    - [redirect302](#cmsrouter-redirect302)
    - [passthru](#cmsrouter-passthru)
    - [generate404](#cmsrouter-generate404)
    - [generateError](#cmsrouter-generateerror)
    - [getPage](#cmsrouter-getpage)
    - [getPageFromFile](#cmsrouter-getpagefromfile)
    - [getPageFileName](#cmsrouter-getpagefileName)
    - [getFile](#cmsrouter-getfile)
    - [getJsonFile](#cmsrouter-getjsonfile)

### *apHarmony\\jsHarmonyCms\\CmsPage Class*

[](#apharmonyjsharmonycmscmspage-class)

- *Public Properties*
    - [seo](#cmspage-seo)
        - [title](#cmspage-seo-title)
        - [keywords](#cmspage-seo-keywords)
        - [metadesc](#cmspage-seo-metadesc)
        - [canonical\_url](#cmspage-seo-canonical_url)
    - [css](#cmspage-css)
    - [js](#cmspage-js)
    - [header](#cmspage-header)
    - [footer](#cmspage-footer)
    - [title](#cmspage-title)
    - [page\_template\_id](#cmspage-page_template_id)
    - [content](#cmspage-content)
    - [properties](#cmspage-properties)
    - [isInEditor](#cmspage-isineditor)
    - [editorScript](#cmspage-editorscript)
    - [notFound](#cmspage-notfound)
- *Public Methods*
    - [fromArray](#cmspagefromarray)

### *apHarmony\\jsHarmonyCms\\CmsResponse Class*

[](#apharmonyjsharmonycmscmsresponse-class)

- [Constructor](#cmsresponse-constructor)
- *Public Properties*
    - [type](#cmsresponse-type)
    - [filename](#cmsresponse-filename)
    - [redirect](#cmsresponse-redirect)

### *apHarmony\\jsHarmonyCms\\CmsPassthruResponse Class*

[](#apharmonyjsharmonycmscmspassthruresponse-class)

- *Public Properties*
    - [http\_code](#cmspassthruresponse-http_code)
    - [content\_type](#cmspassthruresponse-content_type)
    - [content](#cmspassthruresponse-content)
- *Public Methods*
    - [serve](#cmspassthruresponse-serve)

### *apHarmony\\jsHarmonyCms\\CmsRedirect Class*

[](#apharmonyjsharmonycmscmsredirect-class)

- [Constructor](#cmsredirect-constructor)
- *Public Properties*
    - [http\_code](#cmsredirect-http_code)
    - [url](#cmsredirect-url)

### *jsHarmonyCmsEditor Class* (Client JS)

[](#jsharmonycmseditor-class-client-js)

- [Constructor](#jsharmonycmseditor-constructor)

---

*apHarmony\\jsHarmonyCms\\CmsRouter Class*
------------------------------------------

[](#apharmonyjsharmonycmscmsrouter-class-1)

---

CmsRouter Constructor
---------------------

[](#cmsrouter-constructor)

```
new CmsRouter($config)
```

#### Arguments

[](#arguments)

- `$config` (array) :: Associative array with one or more of the configuration keys below:

```
[
  'content_path' => null,
  //(string) File path to published CMS content files

  'redirect_listing_path' => null,
  //(string) Path to redirect listing JSON file (relative to content_path)

  'default_document' => 'index.html',
  //(string) Default Directory Document

  'strict_url_resolution' => false,
  //(bool) Whether to support URL variations (appending "/" or Default Document)

  'passthru_timeout' => 30,
  //(int) Maximum number of seconds for passthru request

  'cms_clientjs_editor_launcher_path' => '/.jsHarmonyCms/jsHarmonyCmsEditor.js',
  //(string) Path where router will serve the client-side JS script that launches CMS Editor

  'cms_server_urls' => [],
  //Array(string) The CMS Server URLs that will be enabled for Page Editing (set to '*' to enable any remote CMS)
  //  * Used by page.editorScript, and the getEditorScript function
  //  * NOT used by jsHarmonyCmsEditor.js - the launcher instead uses access_keys for validating the remote CMS
]
```

#### Example

[](#example)

```
$cmsRouter = new CmsRouter([ 'cms_server_urls' => ['https://cms.example.com'] ]);
```

---

Public Properties
-----------------

[](#public-properties)

---

### CmsRouter-&gt;config

[](#cmsrouter-config)

`(array)`

An associative array with the CmsRouter's config. Config parameters are defined in the Constructor above.

```
$cmsRouter->config['passthru_timeout'] = 60;
```

---

Public Methods
--------------

[](#public-methods)

---

### CmsRouter-&gt;serve

[](#cmsrouter-serve)

`CmsRouter->serve(?string $url = null, array $options = [])`

*Main Entry Point* - Serve CMS Content

#### Parameters

[](#parameters)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL
- `$options: (array)` *(Optional)* An associative array that may have any of the following keys:

    ```
    [
       'onPage' => (function($router, $filename){ }),
       //Function to execute on page route
       //Return value will be passed as return value of "serve" function
       //Default: function($router, $filename){ $router->serveFile($filename); return true; }

       'on301' => (function($router, $url){ }),
       //Function to execute when a 301 redirect is processed
       //Return value will be passed as return value of "serve" function
       //Default: function($router, $url){ $router->redirect301($url); return true; }

       'on302' => (function($router, $url){ }),
       //Function to execute when a 302 redirect is processed
       //Return value will be passed as return value of "serve" function
       //Default: function($router, $url){ $router->redirect302($url); return true; }

       'onPassthru' => (function($router, $url){ }),
       //Function to execute when a PASSTHRU redirect is processed
       //Return value will be passed as return value of "serve" function
       //Default: function($router, $url){ $router->passthru($url)->serve(); return true; }

       'on404' => (function($router){ }|null)
       //Function to execute when on 404 / Page Not Found.  Set to null to continue on Page Not Found.
       //Return value will be passed as return value of "serve" function
       //Default: null

       'onError' => (function($router, $err){ }|null)
       //Function to execute when an unexpected error occurs.  If null, Exception will be thrown instead.
       //Return value will be passed as return value of "serve" function
       //Default: null

       'serveCmsEditorScript' => (bool)
       //Whether the router should serve the CMS Editor Launcher script at config['cms_clientjs_editor_launcher_path']
       //Default: true
    }
    ```

#### Returns

[](#returns)

`(mixed)` Result of the onPage, on301, on302, onPassthru, on404, or onError handler, or TRUE if the return value is null or not defined.

#### Example

[](#example-1)

```
$cmsRouter->serve();
```

---

### CmsRouter-&gt;getStandalone

[](#cmsrouter-getstandalone)

`CmsRouter->getStandalone(?string $url = null)`

*Main Entry Point* - Get CMS Page Data for Standalone Integration

#### Parameters:

[](#parameters-1)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL

#### Returns

[](#returns-1)

`(CmsPage)` Page Content

If page is opened from CMS Editor or Not Found, an empty CmsPage Object will be returned

#### Example

[](#example-2)

```
$cmsRouter->getStandalone();
```

---

### CmsRouter-&gt;getPlaceholder

[](#cmsrouter-getplaceholder)

`CmsRouter->getPlaceholder()`

Get Placeholder Page for Editor template rendering

#### Parameters:

[](#parameters-2)

N/A

#### Returns

[](#returns-2)

`(CmsPage)` Placeholder Page

#### Example

[](#example-3)

```
$cmsRouter->getPlaceholder();
```

---

### CmsRouter-&gt;isInEditor

[](#cmsrouter-isineditor)

`CmsRouter->isInEditor(?string $url = null)`

Checks whether the page is in CMS Edit mode

#### Parameters

[](#parameters-3)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL

#### Returns

[](#returns-3)

`(bool)` True if this page was opened from the CMS Editor

#### Example

[](#example-4)

```
if($cmsRouter->isInEditor()){ /* Perform Operation */ }
```

---

### CmsRouter-&gt;resolve

[](#cmsrouter-resolve)

`CmsRouter->resolve(?string $url = null, array $options = [])`

Converts URL to CMS Content Path

#### Parameters

[](#parameters-4)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL
- `$options: (array)` *(Optional)* An associative array that may have any of the following keys:

    ```
    [
       'strictUrlResolution' => (bool),
       // Whether to try URL variations (adding "/", "/")
       // Default: $this->config['strict_url_resolution']

       'variation' => (int)
       // Starting Variation ID
       // Default: 1
    ]
    ```

#### Returns

[](#returns-4)

`(string)` CMS Content Path

#### Example

[](#example-5)

```
$contentPath = $cmsRouter->resolve($targetUrl);
```

---

### CmsRouter-&gt;route

[](#cmsrouter-route)

`CmsRouter->route(?string $url = null)`

Run CMS router on the target URL

#### Parameters

[](#parameters-5)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL

#### Returns

[](#returns-5)

`(CmsResponse|null)` Response with Page Filename, Redirect, or null if not found

#### Example

[](#example-6)

```
$response = $cmsRouter->route($targetUrl);
```

---

### CmsRouter-&gt;matchRedirect

[](#cmsrouter-matchredirect)

`CmsRouter->matchRedirect(?array $redirects, ?string $url)`

Check if URL matches redirects and return first match

#### Parameters

[](#parameters-6)

- `redirects: (array|null)` Array of CMS Redirects (from getRedirectData function)
- `url: (string|null)` Target URL to match against the CMS Redirects

    Use Full URL, Root-relative URL, or leave blank to use current URL

#### Returns

[](#returns-6)

`(CmsRedirect|null)` Redirect

#### Example

[](#example-7)

```
$redirect = $cmsRouter->matchRedirect($cmsRedirects);
if($redirect && ($redirect->http_code=='301')){
  $cmsRouter->redirect301($redirect->url);
}
```

---

### CmsRouter-&gt;getRedirectData

[](#cmsrouter-getredirectdata)

`CmsRouter->getRedirectData()`

Get CMS Redirect Data

Requires `config['redirect_listing_path']` to be defined

#### Returns

[](#returns-7)

`array|null` JSON array of CMS redirects

#### Example

[](#example-8)

```
$cmsRedirects = $cmsRouter->getRedirectData();
```

---

### CmsRouter-&gt;getEditorScript

[](#cmsrouter-geteditorscript)

`CmsRouter->getEditorScript(?string $url = null)`

Generate script for CMS Editor

#### Parameters

[](#parameters-7)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL

#### Returns

[](#returns-8)

`(string)` HTML Code to launch the CMS Editor

If the page was not launched from the CMS Editor, an empty string will be returned

#### Security

[](#security)

The querystring jshcms\_url parameter is validated against `config['cms_server_urls']`

If the CMS Server is not found in `config['cms_server_urls']`, an empty string will be returned

#### Example

[](#example-9)

```
echo $cmsRouter->getEditorScript();
```

---

### CmsRouter-&gt;serveFile

[](#cmsrouter-servefile)

`CmsRouter->serveFile($filePath)`

Serves a file to the user

#### Parameters

[](#parameters-8)

- `$filePath (string)` Path to target file

#### Example

[](#example-10)

```
$pageFilename = $cmsRouter->getPageFileName();
$cmsRouter->serveFile($pageFilename);
```

---

### CmsRouter-&gt;redirect301

[](#cmsrouter-redirect301)

`CmsRouter->redirect301(string $url)`

Perform 301 Redirect

#### Parameters

[](#parameters-9)

- `$url (string)` Target URL for Redirect

#### Example

[](#example-11)

```
$cmsRouter->redirect301('https://example.com');
```

---

### CmsRouter-&gt;redirect302

[](#cmsrouter-redirect302)

`CmsRouter->redirect302(string $url)`

Perform 302 Redirect

#### Parameters

[](#parameters-10)

- `$url (string)` Target URL for Redirect

#### Example

[](#example-12)

```
$cmsRouter->redirect302('https://example.com');
```

---

### CmsRouter-&gt;passthru

[](#cmsrouter-passthru)

`CmsRouter->passthru(string $url)`

Perform Passthru Request

#### Parameters

[](#parameters-11)

- `$url (string)` Target URL for Passthru Redirect

#### Returns

[](#returns-9)

`(CmsPassthruResponse)` Response

Call the CmsPassthruResponse-&gt;serve() method to serve the page

#### Example

[](#example-13)

```
$cmsRouter->passthru('https://example.com')->serve();
```

---

### CmsRouter-&gt;generate404

[](#cmsrouter-generate404)

`CmsRouter->generate404()`

Generate a 404 Not Found Page

#### Parameters

[](#parameters-12)

N/A

#### Example

[](#example-14)

```
$cmsRouter->generate404();
```

---

### CmsRouter-&gt;generateError

[](#cmsrouter-generateerror)

`CmsRouter->generateError($err)`

Generate a 500 Error Page

#### Parameters

[](#parameters-13)

- `$err (Exception|string)` Error message

#### Example

[](#example-15)

```
$cmsRouter->generateError('An unexpected error has occurred.');
```

---

### CmsRouter-&gt;getPage

[](#cmsrouter-getpage)

`CmsRouter->getPage(?string $url = null, array $options = [])`

Get CMS Page from URL

#### Parameters

[](#parameters-14)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL
- `$options: (array)` *(Optional)* An associative array that may have any of the following keys:

    ```
    [
       'variation' => (int)
       // Starting Variation ID
       // Default: 1
    ]
    ```

#### Returns

[](#returns-10)

`(CmsPage|null)` Page data, or null if page was not found

#### Example

[](#example-16)

```
$page = $cmsRouter->getPage($targetUrl);
```

---

### CmsRouter-&gt;getPageFromFile

[](#cmsrouter-getpagefromfile)

`CmsRouter->getPageFromFile(string $filePath)`

Get CMS Page from file path

#### Parameters

[](#parameters-15)

- `$filePath (string)` Path to target file

#### Returns

[](#returns-11)

`(CmsPage|null)` Page data, or null if page was not found or an error occurred

#### Example

[](#example-17)

```
$page = $cmsRouter->getPageFromFile($filePath);
```

---

### CmsRouter-&gt;getPageFileName

[](#cmsrouter-getpagefilename)

`CmsRouter->getPageFileName(?string $url = null, array $options = [])`

Get CMS Page File

#### Parameters

[](#parameters-16)

- `$url (string|null)` *(Optional)* CMS Page URL

    Use Full URL, Root-relative URL, or leave blank to use current URL
- `$options: (array)` *(Optional)* An associative array that may have any of the following keys:

    ```
    [
       'variation' => (int)
       // Starting Variation ID
       // Default: 1
    ]
    ```

#### Returns

[](#returns-12)

`(string)` Full path to CMS content file

`CmsPageNotFoundException` exception is thrown if page is not found

#### Example

[](#example-18)

```
$pageFile = $cmsRouter->getPageFile($targetUrl);
```

---

### CmsRouter-&gt;getFile

[](#cmsrouter-getfile)

`CmsRouter->getFile($filePath)`

Reads a file from the file system

#### Parameters

[](#parameters-17)

- `$filePath (string)` Path to target file

#### Returns

[](#returns-13)

`(string)` File content

#### Example

[](#example-19)

```
$pageFilename = $cmsRouter->getPageFileName();
$pageContent = $cmsRouter->getFile($pageFilename);
```

---

### CmsRouter-&gt;getJsonFile

[](#cmsrouter-getjsonfile)

`CmsRouter->getJsonFile($filePath)`

Reads and parses a JSON file

#### Parameters

[](#parameters-18)

- `$filePath (string)` Path to target file

#### Returns

[](#returns-14)

`(array|null)` JSON content, or null if file was not found or an error occurred

#### Example

[](#example-20)

```
$pageFilename = $cmsRouter->getPageFileName();
$pageData = $cmsRouter->getJsonFile($pageFilename);
```

---

*apHarmony\\jsHarmonyCms\\CmsPage Class*
----------------------------------------

[](#apharmonyjsharmonycmscmspage-class-1)

---

Public Properties
-----------------

[](#public-properties-1)

---

### CmsPage-&gt;seo

[](#cmspage-seo)

`(CmsPageSeo)`

A class instance with the SEO-related properties for a page

---

### CmsPage-&gt;seo-&gt;title

[](#cmspage-seo-title)

`(string)`

Page content for the header `` tag

---

### CmsPage-&gt;seo-&gt;keywords

[](#cmspage-seo-keywords)

`(string)`

Page content for the header `` tag

---

### CmsPage-&gt;seo-&gt;metadesc

[](#cmspage-seo-metadesc)

`(string)`

Page content for the header `` tag

---

### CmsPage-&gt;seo-&gt;canonical\_url

[](#cmspage-seo-canonical_url)

`(string)`

Page content for the header `` tag

---

### CmsPage-&gt;css

[](#cmspage-css)

`(string)`

Page content for a header `` tag

---

### CmsPage-&gt;js

[](#cmspage-js)

`(string)`

Page content for a header `` tag

---

### CmsPage-&gt;header

[](#cmspage-header)

`(string)`

HTML content to be appended to the `` tag

---

### CmsPage-&gt;footer

[](#cmspage-footer)

`(string)`

HTML content to be appended to the end of the `` tag

---

### CmsPage-&gt;title

[](#cmspage-title)

`(string)`

HTML content to be added to an `` tag in the body

---

### CmsPage-&gt;page\_template\_id

[](#cmspage-page_template_id)

`(string)`

Name of the CMS page template used by this page

---

### CmsPage-&gt;content

[](#cmspage-content)

`(CmsPageDictionary)`

Array of content for this page, indexed by Content Element ID.

#### Example

[](#example-21)

```
echo $page->content->body;
echo $page->content->sidebar;
```

If a content area is not defined, its value will be an empty string.

---

### CmsPage-&gt;properties

[](#cmspage-properties)

`(CmsPageDictionary)`

Array of property values for this page, indexed by property name.

#### Example

[](#example-22)

```
if($page->properties->showTitle != 'N'){
  echo ''.htmlspecialchars($page->title).'';
}
```

If a property is not defined, its value will be an empty string.

---

### CmsPage-&gt;isInEditor

[](#cmspage-isineditor)

`(bool)`

True if the page was detected to have been opened by the CMS.

---

### CmsPage-&gt;editorScript

[](#cmspage-editorscript)

`(string)`

If the page was opened by the CMS, the script tag used to launch the CMS Editor. Otherwise, an empty string.

---

### CmsPage-&gt;notFound

[](#cmspage-notfound)

`(bool)`

Set to true by CmsRouter-&gt;getStandalone if no matching content was found when the page content was supposed to be rendered (when not in CMS Editor mode).

---

Public Methods
--------------

[](#public-methods-1)

---

### CmsPage::fromArray

[](#cmspagefromarray)

`CmsPage::fromArray($data)`

Generate a CmsPage object from JSON data

#### Parameters

[](#parameters-19)

- `$data (array)` CMS JSON Page Content

#### Returns

[](#returns-15)

`(CmsPage)` Page

#### Example

[](#example-23)

```
$page = CmsPage::fromArray([
  'title'=>'Welcome',
  'content'=>['body'=>'Hello World']
]);
```

---

*apHarmony\\jsHarmonyCms\\CmsResponse Class*
--------------------------------------------

[](#apharmonyjsharmonycmscmsresponse-class-1)

---

CmsResponse Constructor
-----------------------

[](#cmsresponse-constructor)

```
new CmsResponse($type)
```

#### Arguments

[](#arguments-1)

- `$type (string)` Type of the response - 'page' or 'redirect'

#### Example

[](#example-24)

```
$response = new CmsResponse('page');
```

---

Public Properties
-----------------

[](#public-properties-2)

---

### CmsResponse-&gt;type

[](#cmsresponse-type)

`(string|null)`

Type of the response - 'page' or 'redirect'

---

### CmsResponse-&gt;filename

[](#cmsresponse-filename)

`(string|null)`

Page filename, if response type is "page"

---

### CmsResponse-&gt;redirect

[](#cmsresponse-redirect)

`(CmsRedirect|null)`

Redirect, if response type is "redirect"

---

*apHarmony\\jsHarmonyCms\\CmsPassthruResponse Class*
----------------------------------------------------

[](#apharmonyjsharmonycmscmspassthruresponse-class-1)

---

Public Properties
-----------------

[](#public-properties-3)

---

### CmsPassthruResponse-&gt;http\_code

[](#cmspassthruresponse-http_code)

`(int|null)`

The HTTP response code from the target passthru page

---

### CmsPassthruResponse-&gt;content\_type

[](#cmspassthruresponse-content_type)

`(string|null)`

The HTTP content type from the target passthru page

---

### CmsPassthruResponse-&gt;content

[](#cmspassthruresponse-content)

`(string|null)`

The HTML content from the target passthru page

---

Public Methods
--------------

[](#public-methods-2)

---

### CmsPassthruResponse-&gt;serve

[](#cmspassthruresponse-serve)

`CmsPassthruResponse->serve()`

Serve the passthru content to the user

#### Parameters

[](#parameters-20)

N/A

#### Example

[](#example-25)

```
$cmsRouter->passthru('https://example.com')->serve();
```

---

*apHarmony\\jsHarmonyCms\\CmsRedirect Class*
--------------------------------------------

[](#apharmonyjsharmonycmscmsredirect-class-1)

---

### CmsRedirect Constructor

[](#cmsredirect-constructor)

```
new CmsRedirect($http_code, $url)
```

#### Arguments

[](#arguments-2)

- `$http_code (string)` HTTP Code ('301', '302' or 'PASSTHRU')
- `$url (string)` Destination URL

#### Example

[](#example-26)

```
$redirect = new CmsRedirect('301', 'https://example.com');
```

---

Public Properties
-----------------

[](#public-properties-4)

---

### CmsRedirect-&gt;http\_code

[](#cmsredirect-http_code)

`(string|null)`

HTTP Code ('301', '302' or 'PASSTHRU')

---

### CmsRedirect-&gt;url

[](#cmsredirect-url)

`(string|null)`

Destination URL

---

*jsHarmonyCmsEditor Class (Client JS)*
--------------------------------------

[](#jsharmonycmseditor-class-client-js-1)

---

### jsHarmonyCmsEditor Constructor

[](#jsharmonycmseditor-constructor)

```
jsHarmonyCmsEditor(config)
```

#### Arguments

[](#arguments-3)

- `config` (Object) :: Object with one or more of the configuration keys below:

```
{
  access_keys: [],
  //Array(string) CMS Editor Access Keys, used to validate remote CMS URL
}
```

#### Example

[](#example-27)

```
//Load the CMS Editor in this page
jsHarmonyCmsEditor({ access_keys: ['*****ACCESS_KEY*****'] });
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~1 days

Total

8

Last Release

1665d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13336454?v=4)[apHarmony](/maintainers/apharmony)[@apHarmony](https://github.com/apHarmony)

---

Top Contributors

[![palczewski](https://avatars.githubusercontent.com/u/13336442?v=4)](https://github.com/palczewski "palczewski (11 commits)")

---

Tags

phpsdkcontentcmsjsHarmony

### Embed Badge

![Health badge](/badges/apharmony-jsharmony-cms-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/apharmony-jsharmony-cms-sdk-php/health.svg)](https://phpackages.com/packages/apharmony-jsharmony-cms-sdk-php)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)[wxm/pdd-sdk

拼多多 SDK 封装, 调用简单、语义化增强。支持 Laravel/Lumen。

154.7k](/packages/wxm-pdd-sdk)[clever/clever-php

231.6k](/packages/clever-clever-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
