This implementation confuses me a bit, and maybe it's because we aren't able to see the whole picture.
First, I don't understand the purpose of the adminTemplate::load() method. It is basically just a constructor. If you eventually plan to add more complexity to it (use it as a builder, factory, or to make adminTemplate a singleton), then it makes sense, but as it stands now, you might as well just use a constructor.
The relationship between sidebarGuide and wrapSidebars is not totally clear either. If wrapSidebars is only ever called with the result of sidebarGuide as a parameter, then drop the parameter and convert sidebarGuide into a private helper method. If, on the other hand, wrapSidebars can be called with more than the output of sidebarGuide, but sidebarGuide is always wrapped with wrapSidebars, simply wrap the return value of sidebarGuide:
public function sidebarGuide() { return $this->wrapSidebars('content'); // Very long html markup }
If sidebars are not always wrapped, but only sidebars are wrapped, you could create a decorator class to wrap around your adminTemplate instance that gets the content from the delegate, and returns the content, wrapped.
class adminTemplate { # Constructor function sidebarGuide() { ... } } class TemplateDecorator { protected $template; # Constructor protected function wrapSidebars() { ... } function sidebarGuide() { return $this->wrapSidebars($this->template->sidebarGuide()); } }
The one other thing that confuses me is the implementation of wrapSidebars. You use ob_* functions and echos, but all of the pieces are already strings? You could more simply use string concatenation/interpolation:
public function wrapSidebars($content) { return "<div class='sidebar wrapper'>$content</div>"; }
There may be a (very) minor difference in performance, but the simplicity of the code should outweigh the micro-optimization.