Actions guide
Actions is the routing core module of Cherrycake, and allows your application to receive requests and attend them accordingly.
<?php
namespace CherrycakeApp\Home;
class Home extends \Cherrycake\Module {
public static function mapActions() {
global $e;
$e->Actions->mapAction([
"home",
new \Cherrycake\Actions\ActionHtml([
"moduleType" => ACTION_MODULE_TYPE_APP,
"moduleName" => "Home",
"methodName" => "viewHome",
"request" => new \Cherrycake\Actions\Request([
"pathComponents" => false
])
])
]);
}
function viewHome() {
// Show the home page
}
}Last updated