Welcome Guest, Not a member yet? Register   Sign In
Poll: Should something like this view_layout method be included?
You do not have permission to vote in this poll.
Yes
30.00%
3 30.00%
No
60.00%
6 60.00%
Maybe - see comments
10.00%
1 10.00%
Total 10 vote(s) 100%
* You voted for this item. [Show Results]

View Layouts - Input Desired
#8

I think that CI 4 needs some kind of layouting..
At CI 3 I usually do something as ..
At MY_Loader I overwrite the view with something simple as: 

PHP Code:
public $template NULL;
public function 
view($view$vars = array(), $return FALSE)
{
    if(empty($this->template)) {
        return $this->_ci_load(array('_ci_view' => $view'_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
 
   }
    
    $vars
['_view_content_'] = $this->_ci_load(array('_ci_view' => $view'_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => TRUE));
    return $this->_ci_load(array('_ci_view' => $this->template'_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));


And after that just at the layout I output the "_view_content_" ..

I think that for CI4 such regular "hacks" should be prevented.
When there is some kind of problem often mentioned it will be good if there is build in solution.
Best VPS Hosting : Digital Ocean
Reply


Messages In This Thread
View Layouts - Input Desired - by kilishan - 07-10-2016, 09:05 PM
RE: View Layouts - Input Desired - by PaulD - 07-11-2016, 06:09 AM
RE: View Layouts - Input Desired - by sintakonte - 07-11-2016, 07:13 AM
RE: View Layouts - Input Desired - by prezire - 07-11-2016, 05:42 PM
RE: View Layouts - Input Desired - by PaulD - 07-11-2016, 09:39 PM
RE: View Layouts - Input Desired - by albertleao - 07-11-2016, 09:52 PM
RE: View Layouts - Input Desired - by kilishan - 07-11-2016, 09:59 PM
RE: View Layouts - Input Desired - by sv3tli0 - 11-05-2016, 01:07 AM
RE: View Layouts - Input Desired - by cartalot - 11-17-2016, 01:29 PM
RE: View Layouts - Input Desired - by PaulD - 11-17-2016, 03:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB