Skip to content

Instantly share code, notes, and snippets.

@abackstrom
Created April 25, 2012 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abackstrom/2490015 to your computer and use it in GitHub Desktop.
Save abackstrom/2490015 to your computer and use it in GitHub Desktop.
Rendering partials within a layout
<h2>index.phtml</h2>
<?php
require 'klein/klein.php';
respond( function( $request, $response, $app ) {
$response->layout( 'wrapper.phtml' );
$response->render( 'index.phtml' );
});
dispatch();
<h2>sidebar.phtml</h2>
<h1>BEGIN wrapper.phtml</h1>
<?php $this->partial( 'sidebar.phtml' ); ?>
<?php $this->yield(); ?>
<h1>END wrapper.phtml</h1>
@abackstrom
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment