A client package for Bear CMS. It's a perfect choice for developers who want to provide content editing functionality while taking full ownership of the output code. Also suitable for building websites from HTML templates.
composer require bearcms/universalThe library's autoloader will be automatically run when including vendor/autoload.php.
You can quick start a new project by running
composer create-project bearcms/universal-app [my-app-name]
Download the latest release ZIP file from from the releases page. Then unzip and include the library's autoloader.
include 'path-to-bearcms-universal-client/autoload.php';Download the latest release PHAR file from from the releases page. Then include itclude it in your project.
include 'path-to-bearcms-universal-client.phar';The first step is to create and configure the BearCMS\Universal instance.
$bearCMS = new BearCMS\Universal([
'dataDir' => __DIR__ . '/../bearcms/data', // The directory where the website data will be stored
'logsDir' => __DIR__ . '/../bearcms/logs', // The directory for logs
'appSecretKey' => 'TODO' // Get your app secret key from https://bearcms.com/
]);Then use captureStart() and captureSend() to automatically capture the output HTML and send it to the Bear CMS client.
$bearCMS->captureStart();
// Place the HTML code of your page here (or include it from other file)
$bearCMS->captureSend();Alternatively you can use ...
$response = $bearCMS->makeResponse('SOME HTML CODE');
$bearCMS->send($response);Any <bearcms...> HTML tags will be automatically updated for preview or editing (if there is a logged in administrator).
A full list of the supported HTML tags is available at https://bearcms.com/support/use-custom-elements/
This project is licensed under the MIT License. See the license file for more information.
This package is created and maintained by the Bear CMS team. Feel free to contact us at support@bearcms.com or bearcms.com.