Created
March 3, 2009 18:50
-
-
Save shadowhand/73452 to your computer and use it in GitHub Desktop.
This file contains 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 | |
public function index($product = NULL) | |
{ | |
// Load the product | |
$product = ORM::factory('product', $product); | |
if ( ! View::is_cached('product_intel_25')) | |
{ | |
// Cache the product details page | |
$content = View::factory('product/details') | |
->bind('product', $product) | |
->cache('product_intel_25'); | |
} | |
// Prepare the product prices view | |
$price = View::factory('product/prices') | |
->bind('prices', $product_prices); | |
// Get the prices for this product based on the user preferences | |
$product_prices = $product->get_prices(user_prefs::get('currency_main'), user_prefs::get('currency_second')); | |
// Create the non-cached template values | |
$values = array | |
( | |
'price' => $price->render(), | |
); | |
// Render the cached content | |
$this->content = View::render_cache('product_intel_25', $tpl_values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment