Hello everybody,

I want to switch the template/view production of my project to phptal.
Currently it is done via plain php (normal "CodeIgniter" style).

The problem is, i do not have one big template in which i output my variables,
but instead a nested set of fragments.

For example:
There is a main page that does nothing but define the basic html structure
with head and body. Inside this file multiple other files are loaded
and embedded.

So i have something like this:
    <? $this->load->view('page/includes.php')?>
  <? $this->load->view('page/topnav.php')?>

In the includes.php there are routines to embed all required css and js files.
topnav.php defines the top navigation.
(These "$this->load..." statements are codeigniter statements to load a view)
Now the problem is:
When loading the topnav.php some variables are passed to it (in fact
they are passed to
the main page, but when loading another template in this page, they
are also available there).
I need those variables to determine wether the user is an admin (and
display some admin-only
links etc), greet the user by name etc.

Now the question is:
can this be done via phptal as well?

I want: nested templates with automatically passed variables.

I googled it (even tough i was not sure about my query string) and
read through the archives but
could not find a solution to my problem.

Thanks for your time,
Julian B.

PHPTAL mailing list

Reply via email to