I need to set a constant value to one or more fields, but i can't do it.
This is my code:
public function PortalesPropiedades()
{
if (isset($_GET['IdPropiedad']))
$_SESSION['IdPropiedad'] = $_GET['IdPropiedad'];
$this->grocery_crud->set_table('propiedadesportales');
$this->grocery_crud->where('IdPropiedad',$_SESSION['IdPropiedad']);
$this->grocery_crud->set_relation('IdPortal','portales','Portal');
$this->grocery_crud->columns('IdPortal','URL');
$this->grocery_crud->required_fields('IdPortal','URL');
$this->grocery_crud->display_as('IdPortal','Portal');
$this->grocery_crud->callback_before_insert(array($this,'PortalesPropiedadesInsert'));
$output = $this->grocery_crud->render();
$this->PortalesPropiedadesOutput($output);
}
function PortalesPropiedadesInsert($post_array) {
$post_array['idpropiedad'] = $_SESSION['IdPropiedad'];
return $post_array;
}
function PortalesPropiedadesOutput($output = null)
{
$this->load->view('vista_iframe.php',$output);
}