/
Block.class.php
33 lines (29 loc) · 975 Bytes
/
Block.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
Library::import('recess.framework.helpers.exceptions.MissingRequiredDrawArgumentsException');
Library::import('recess.framework.helpers.exceptions.BlockToStringException');
/**
* A Block is a fundamental unit of UI in Recess.
*
* @author Kris Jordan
* @since 0.20
*/
abstract class Block {
/**
* Output the contents of the block. Returns true if successful or false if
* the block is empty. Sub-classes of block may optionally require parameters
* be passed to draw. If these parameters are not passed as expected the
* sub-class must throw an exception of type MissingRequiredDrawArgumentsException.
*
* @return boolean
*/
public abstract function draw();
/**
* Return the contents of this block as a string. If the block is not fully
* formed (i.e., it's draw requires an argument), then __toString will throw
* an exception of type BlockToStringException.
*
* @return string
*/
public abstract function __toString();
}
?>