Skip to content

Commit

Permalink
Add Accessable for Renderer On RouterView
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCookie authored and MrCookie committed Jun 30, 2022
1 parent acd946c commit 3081f13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/RouteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ private function __construct()
parent::service();
}
final static public function Instance() { return call_user_func_array(array(self::$this, '__instance'), array()); }
final public function Renderer() { return call_user_func_array(array($this, '__renderer'), array(func_get_args())); }

final static protected function __instance()
{
Expand All @@ -22,6 +23,11 @@ final static protected function __instance()
$_view->loadLayout();
}
return $_inst;
}
}

final protected function __renderer($args)
{
return $this->__getView();
}

}
9 changes: 9 additions & 0 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ final public function HtmlJson() { return call_user_func_array(array($this, '__h
final public function SetHeaderLayout( $layout ) { return $this->__setHeaderLayout( $layout ); }
final public function SetFooterLayout( $layout ) { return $this->__setFooterLayout( $layout ); }
final public function SetMainLayout( $layout ) { return $this->__setMainLayout( $layout ); }
final public function HeaderLayout( $layout ) { return $this->__setHeaderLayout( $layout ); }
final public function FooterLayout( $layout ) { return $this->__setFooterLayout( $layout ); }
final public function HeadLayout( $layout ) { return $this->__setHeaderLayout( $layout ); }
final public function FootLayout( $layout ) { return $this->__setFooterLayout( $layout ); }
final public function HLayout( $layout ) { return $this->__setHeaderLayout( $layout ); }
final public function FLayout( $layout ) { return $this->__setFooterLayout( $layout ); }
final public function MainLayout( $layout ) { return $this->__setMainLayout( $layout ); }
final public function EngineLayout( $layout_content = NULL, $vars = NULL ) { return $this->__engineLayout( $layout_content, $vars ); }
final public function RenderLayout( $vars = NULL ) { return $this->__renderLayout( $vars ); }
final public function RenderBlock( $block, $args = NULL ) { return $this->__renderBlock( $block, $args ); }
Expand Down Expand Up @@ -328,12 +335,14 @@ private function __setFooterLayout( $layout )
{
$this->__setFooterLayoutPath( $layout );
$this->__loadFooter();
return $this;
}

private function __setHeaderLayout( $layout )
{
$this->__setHeaderLayoutPath( $layout );
$this->__loadHeader();
return $this;
}

private function __addBlock( $block, $force_name )
Expand Down

0 comments on commit 3081f13

Please sign in to comment.