1: <?php
2: /**
3: * @category Horde
4: * @package View
5: */
6:
7: /**
8: * Horde_View_Interface is a reference for classes to be used as Horde
9: * Views. Implementing it is optional; type hinting is not used to
10: * enforce the interface.
11: *
12: * @category Horde
13: * @package View
14: */
15: interface Horde_View_Interface
16: {
17: /**
18: * Undefined variables return null.
19: *
20: * @return null
21: */
22: public function __get($name);
23:
24: /**
25: * Accesses a helper object from within a template.
26: *
27: * @param string $method The helper method.
28: * @param array $args The parameters for the helper.
29: *
30: * @return string The result of the helper method.
31: */
32: public function __call($name, $args);
33:
34: /**
35: * Adds to the stack of template paths in LIFO order.
36: *
37: * @param string|array The directory (-ies) to add.
38: */
39: public function addTemplatePath($path);
40:
41: /**
42: * Resets the stack of template paths.
43: *
44: * To clear all paths, use Horde_View::setTemplatePath(null).
45: *
46: * @param string|array The directory (-ies) to set as the path.
47: */
48: public function setTemplatePath($path);
49:
50: /**
51: * Adds to the stack of helpers in LIFO order.
52: *
53: * @param Horde_View_Helper|string $helper The helper instance to add.
54: *
55: * @return Horde_View_Helper Returns the helper object that was added.
56: */
57: public function addHelper($helper);
58:
59: /**
60: * Assigns multiple variables to the view.
61: *
62: * The array keys are used as names, each assigned their corresponding
63: * array value.
64: *
65: * @param array $array The array of key/value pairs to assign.
66: */
67: public function assign($array);
68:
69: /**
70: * Processes a template and returns the output.
71: *
72: * @param string $name The template to process.
73: *
74: * @return string The template output.
75: */
76: public function render($name);
77:
78: /**
79: * Sets the output encoding.
80: *
81: * @param string $encoding A character set name.
82: */
83: public function setEncoding($encoding);
84:
85: /**
86: * Returns the current output encoding.
87: *
88: * @return string The current character set.
89: */
90: public function getEncoding();
91: }
92: