⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

_theme_view()



crina

crina
  • profile picture
  • Member

Posted 02 May 2012 - 09:12 AM

Hello,

I would like to make this function, use the default load->view() function from codeigniter... if you send it the second parameter to true, you can have the view in a string format, exactly the same way you are doing it in the _theme_view function...

or is there a reason why you don't use this ? I think it uses the exact same mechanism or do I miss something ?

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 02 May 2012 - 20:37 PM

Very similar yes, but the main difference is:[list=1]
[*]the views are called only from the theme that you have choose.
[*]all the views are collected to a string inside the grocery CRUD
[/list]
it is just for internal use that's why I make it private.

So you can simply use codeigniter's view and you can do this:


public function view($view, $vars = array(), $return = FALSE)
{
$ci = &get_instance();
return $ci->load->view($view, $vars , $return );
}

crina

crina
  • profile picture
  • Member

Posted 17 May 2012 - 07:40 AM

Hello again,

I have tried to change _theme_view like this:


public function _theme_view($view, $vars = array(), $return = FALSE)
{
if ($return === TRUE)
{
return $this->CI->load->view("bo/standard/datatables/".$view, $vars , $return);
}

$this->views_as_string .= $this->CI->load->view("bo/standard/datatables/".$view, $vars , $return);
}

but it doesn't work like it should ... ( $CI is declared as global var and it is instantiated in the constructor of the class ... )

any ideas why ?

crina

crina
  • profile picture
  • Member

Posted 17 May 2012 - 13:26 PM

have no idea what is the problem ... but I gave up ... I have succeeded in using my own translating system in the list views, in another way ... so for now I will let the _theme_view as it is ...