|
|
@@ -417,6 +417,8 @@ class View {
|
|
|
* @param string|null $layout Layout to use.
|
|
|
* @return string|null Rendered content or null if content already rendered and returned earlier.
|
|
|
* @throws \Cake\Core\Exception\Exception If there is an error in the view.
|
|
|
+ * @triggers View.beforeRender $this, array($viewFileName)
|
|
|
+ * @triggers View.afterRender $this, array($viewFileName)
|
|
|
*/
|
|
|
public function render($view = null, $layout = null) {
|
|
|
if ($this->hasRendered) {
|
|
|
@@ -448,6 +450,8 @@ class View {
|
|
|
* @param string|null $layout Layout name
|
|
|
* @return mixed Rendered output, or false on error
|
|
|
* @throws \Cake\Core\Exception\Exception if there is an error in the view.
|
|
|
+ * @triggers View.beforeLayout $this, array($layoutFileName)
|
|
|
+ * @triggers View.afterLayout $this, array($layoutFileName)
|
|
|
*/
|
|
|
public function renderLayout($content, $layout = null) {
|
|
|
$layoutFileName = $this->_getLayoutFileName($layout);
|
|
|
@@ -579,6 +583,16 @@ class View {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Check if a block exists
|
|
|
+ *
|
|
|
+ * @param string $name Name of the block
|
|
|
+ * @return bool
|
|
|
+ */
|
|
|
+ public function exists($name) {
|
|
|
+ return $this->Blocks->exists($name);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* End a capturing block. The compliment to View::start()
|
|
|
*
|
|
|
* @return void
|
|
|
@@ -707,6 +721,8 @@ class View {
|
|
|
* View::$viewVars will be used.
|
|
|
* @return string Rendered output
|
|
|
* @throws \LogicException When a block is left open.
|
|
|
+ * @triggers View.beforeRenderFile $this, array($viewFile)
|
|
|
+ * @triggers View.afterRenderFile $this, array($viewFile, $content)
|
|
|
*/
|
|
|
protected function _render($viewFile, $data = array()) {
|
|
|
if (empty($data)) {
|
|
|
@@ -1043,6 +1059,8 @@ class View {
|
|
|
* @param array $data Data to render
|
|
|
* @param array $options Element options
|
|
|
* @return string
|
|
|
+ * @triggers View.beforeRender $this, array($file)
|
|
|
+ * @triggers View.afterRender $this, array($file, $element)
|
|
|
*/
|
|
|
protected function _renderElement($file, $data, $options) {
|
|
|
$current = $this->_current;
|