Created
April 25, 2012 14:18
-
-
Save abackstrom/2490015 to your computer and use it in GitHub Desktop.
Rendering partials within a layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>index.phtml</h2> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'klein/klein.php'; | |
respond( function( $request, $response, $app ) { | |
$response->layout( 'wrapper.phtml' ); | |
$response->render( 'index.phtml' ); | |
}); | |
dispatch(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>BEGIN wrapper.phtml</h1> | |
<?php $this->partial( 'sidebar.phtml' ); ?> | |
<?php $this->yield(); ?> | |
<h1>END wrapper.phtml</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See klein/klein.php#37