Session guide
The Session module provides a session tracking and session storage mechanism.
Setting up the Session database table
Working with Session
<?php
namespace CherrycakeApp\HelloWorld;
class HelloWorld extends \Cherrycake\Module {
public static function mapActions() {
global $e;
$e->Actions->mapAction(
"home",
new \Cherrycake\ActionHtml([
"moduleType" => \Cherrycake\ACTION_MODULE_TYPE_APP,
"moduleName" => "HelloWorld",
"methodName" => "show",
"request" => new \Cherrycake\Actions\Request([
"pathComponents" => false,
"parameters" => false
])
])
);
}
function show() {
global $e;
$e->Output->setResponse(new \Cherrycake\Actions\ResponseTextHtml([
"code" => \Cherrycake\RESPONSE_OK,
"payload" =>
$e->HtmlDocument->header().
"Hello world!".
$e->HtmlDocument->footer()
]));
}
}Last updated