working with php
Sitecake works with PHP files as well as plain HTML. If you’re using Sitecake with a PHP website, there are several things to know.
-
The complete
sc-contentelement should be contained inside a single file. Opening it in one file and closing it in another will not work. -
PHP code inside an
sc-contentelement will be overwritten with rendered HTML after the first save or publish. -
Paths used in PHP
includeandrequiremethods that contain editable content should be relative, because Sitecake creates copies of your files and works with the copies. If you use absolute paths, Sitecake will always include the original files, and changes tosc-contentelements inside included files won’t appear until you publish.
Sitecake files and folders
Here is the structure inside the
sitecake/ folder:
sitecake/
<version>/ version folder
client/
editor-v4/ in-page editor (JS/CSS)
pagemanager/ page manager (JS/CSS)
config/ configuration files
bootstrap.php application bootstrap
requirements.php environment check
config.php Sitecake configuration
locale/ translation files
src/ server source files
Sitecake/ Sitecake classes
app.php services entry point
credentials.php credentials file
credentials.php.default reset credentials file
editor.cnf editor configuration
sitecake.php application entry point
Misc
Sitecake supports memcache, memcached, and Redis session handling.