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
#4

(This post was last modified: 07-11-2016, 05:49 PM by prezire.)

I'm not sure if this would help but in CI3, I usually implement a helper. Something like:

PHP Code:
//view_helper.php
function render($partial)
{
 
 view('layouts/header');
 
 view('partials/' $partial);
 
 view('layouts/footer');


And in either controller or view, I call it like:
PHP Code:
//User.php
public function index()
{
  
//Some stuff...
  
vars(['users' => $users]);
  
render('users/index');

Long live CodeIgniter!
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