-
Book Overview & Buying
-
Table Of Contents
concrete5 Cookbook
The block controller class contains a couple of special functions that get automatically called at different points throughout the page load process. You can look into these callbacks to power different functionalities of your block type.
To get started, you will need a block type created and installed. See the previous recipe for a lesson on creating a custom block type. We will be adding some methods to controller.php.
The steps for using block controller callback functions are as follows:
Open your block's controller.php file.
Add a new function called on_start():
public function on_start() {
}Write a die statement that will get fired when the controller is loaded.
die('hello world');Refresh any page containing the block type. The page should stop rendering before it is complete with your debug message.
Be sure to remove the die statement, otherwise your block won't work anymore!
concrete5 will call the various...
Change the font size
Change margin width
Change background colour