Welcome Guest, Not a member yet? Register   Sign In
Reverse Parsing (CI parser template) ??
#1

[eluser]rpe[/eluser]
Usually if we want to parse a variable, we need to define it first. Can we do the opposite way? Parsing first and define the variable later??

Example :
1.>This is what I usually do, I define the variable first, I put it in var.php.
Code:
class Example extends Controller{
function index(){
data['variable']=$this->load->view('variable','',TRUE);
$this->load->view('display');
}
}

then I use the variable in display.php
Code:
<html>
<head></head>
<body>
{variable}
</body>
</html>

2.>But, what I want is this, I use the variable first (in display.php)
Code:
<html>
<head></head>
<body>
{variable}
</body>
</html>

then I parse using this (var.php)
Code:
data[$var]=$this->load->view($var);

Thanks before.


Messages In This Thread
Reverse Parsing (CI parser template) ?? - by El Forum - 08-14-2009, 06:21 AM
Reverse Parsing (CI parser template) ?? - by El Forum - 08-14-2009, 07:28 AM
Reverse Parsing (CI parser template) ?? - by El Forum - 08-14-2009, 07:32 AM
Reverse Parsing (CI parser template) ?? - by El Forum - 08-14-2009, 07:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB