Can't rendering a page

64 views
Skip to first unread message

vladu sorin

unread,
May 23, 2011, 12:26:27 PM5/23/11
to Limonade
Hi to everyone.

I'm new with limonade. I can't render a view page (template page).

I've set views_dir properly with option('views_dir,'path/to/my/
template'); and in a controller function I have something like:

return render('index.tpl.php', null, array('name' => 'John Doe' ));

That's doesn't pass this variable to my view page(index.tpl.php); it
just output the 'index.tpl.php' string.

I've tried to include a view page with html function too, like as I
said in blog example developed with limonade framework, but the result
is the same. All functions prints the file name which I want to be
included.

Anyone can help me please?

Fabrice Luraine

unread,
May 23, 2011, 12:44:44 PM5/23/11
to limo...@googlegroups.com
There might be something wrong with your view path. Can you describe your directory structure and what's your view path?

--
Fabrice.

> --
> You received this message because you are subscribed to the Google Groups "Limonade" group.
> To post to this group, send email to limo...@googlegroups.com.
> To unsubscribe from this group, send email to limonade+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/limonade?hl=en.
>

vladu sorin

unread,
May 23, 2011, 2:20:45 PM5/23/11
to Limonade
I have this structure:

|- configuration.php
|- bootstrap.php
|- includes/
|- lib/
|- limonade.php
|- app/
|- controllers
|- main.controller.php
|- templates
|- default
|- index.tpl.php

That is my directory structure. I have in configuration.php these
lines:

define('TEMPLATE_NAME','default');
define('TEMPLATE_PATH', ROOT_PATH.'/app/templates/'.TEMPLATE_NAME);

option('views_dir', TEMPLATE_PATH);

and in main.controller.php these lines:

function index(){

return render('index.tpl.php', null, array('name' => 'John Doe' ));

}

Thanks you.

vladu sorin

unread,
May 23, 2011, 2:23:27 PM5/23/11
to Limonade
I'm sorry, I've forgot about ROOT_PATH constant. I've defined it like:

define('ROOT_PATH',dirname(__FILE__));

in configuration.php

xangelo

unread,
May 24, 2011, 10:14:17 AM5/24/11
to Limonade
Can you echo out TEMPLATE_PATH to ensure that it is pointing to the
right location?

Fabrice Luraine

unread,
May 24, 2011, 1:34:13 PM5/24/11
to limo...@googlegroups.com
Where is your main bootstrap file where you load limonade ?

--
Fabrice.

vladu sorin

unread,
May 25, 2011, 9:02:17 AM5/25/11
to Limonade
This is the output of the TEMPLATE_PATH constant.

/var/www/mywebsites/pcportal/subdomenii/projects/index/src/app/
templates/default

The main bootstrap which loads the limonade it's the bootstrap from
the root of the site (look at my scheme from above, there are two
files in root, configuration.php and bootstrap.php).

vladu sorin

unread,
May 25, 2011, 2:14:08 PM5/25/11
to Limonade
I've solved. I've debugged the route function and I had seen the views
path doesn't was updated from my opion(...) function, so I did some
modifications in limonade library and everything is fine.

Thanks you.
Reply all
Reply to author
Forward
0 new messages