I'm trying to parse a view with BBCode, and it works fine. But there is one feature I don't know how to implement.
[box=test] should be replaced with $this->load->view('admin/news/test', '', true);
This is my code so far:
$CI =& get_instance();
$view = preg_replace("'\[box=(.*?)\]'i", "\\1", $str);
The thing here is that \1 will be the name of the view I want to load. Ideally, I'd want to do something like this:
$CI =& get_instance();
$str = preg_replace("'\[box=(.*?)\]'i", $CI->load->view('admin/news/'."\\1", '', true), $str);
return $str;
So hopefully you understand from this example what I am trying to do. But I don't have any clue how to really do it?
thanks