예제 #1
0
 public function index()
 {
     // In Kohana, all views are loaded and treated as objects.
     $this->template->content = new View('occasions');
     // getOccasions and getOccasion($id) is a method defined in Occasion_Model
     $occasions = new Occasion_Model();
     $this->template->content->occasionresults = $occasions->getOccasions();
     $occasion = $occasions->getOccasionByName($occasions->find(1)->name);
     $this->template->content->occasion = $occasion;
     $occasion->meta_description = 'blah';
     $occasion->meta_keywords = 'blah';
     $occasion->meta_title = 'blah';
     $this->template->metaDescription = $occasion->meta_description;
     $this->template->metaKeywords = $occasion->meta_keywords;
     $this->template->metaTitle = $occasion->meta_title;
     // You can assign anything variable to a view by using standard OOP
     // methods. In my welcome view, the $title variable will be assigned
     // the value I give it here.
     $this->template->title = $occasion->meta_title;
     // getProducts is a method defined in Product_Model
     $products = new Product_Model();
     $this->template->content->productresults = $products->getProductsForSite(TRUE);
 }
예제 #2
0
	oFCKeditor.Width = '100%' ;
	oFCKeditor.Height = '300' ; 
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;	
	
}
</script>

<?php 
$id = $this->uri->segment(3);
$argumentarray = Router::$arguments;
$occasions = new Occasion_Model();
if (isset($argumentarray[0])) {
    $id = $argumentarray[0];
    //$occasion = $occasions->getOccasionByID($id);
    $occasion = $occasions->find($id);
} else {
    $id = $occasions->getNextID();
    //$occasion = ORM::factory('occasion');
    $occasion = $occasions;
    //$descs = new Occasions_description_Model;
    //$occasion->occasions_description = $descs;
}
//var_dump($occasion);
//$desc = ORM::factory('occasions_description')->find($occasion->occasions_description_id);
//$occasions_description = ORM::factory('occasions_description')->find($occasion->occasions_description_id);
$i = 0;
$j = 0;
?>