[eluser]Unknown[/eluser]
hi every body
i'm creating a simple cms with ci and i have a problem in creating blocks here is the block code im using :
Code:
class Blocks extends Model
{
function Blocks()
{
parent::Model();
}
function get($pos){
$this->load->database();
//select from blocks where block_position =position and active = 1 and show in section name
//do foreach and get type and function show by type
$sql = "SELECT * FROM blocks WHERE postion= '$pos' AND active =1";
$query = $this->db->query($sql);
foreach ($query->result_array() as $row){
if ($row['type']=='stat'){
$row['continent']=$row['continent'];
}else {
$bcname=$row['name'];
$CI =& get_instance();
$CI->load->model($bcname);
$returndata = $CI->$bcname->show();
$row['continent']= $returndata;
}
$result[] = $row;
$this->load->view($row['view'], $row);//this is the broblem
}
}
every thing work fine but the blocks is show in the front of my view file and i didn't figure what is going wrong
here is my view file
Code:
<?php
$this->load->view($head);
?>
echo $blocks;//returned from the controller //[[$data['blocks']=$this->Blocks->get('right');]]
<?
$this->load->view($foot);
?>
and i get the blocks in the front of my Main view file not in the position i want them to show in .
please help or just any thought about this issue