|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
quali74 Smarty Rookie
Joined: 09 May 2006 Posts: 10
|
Posted: Tue May 09, 2006 5:23 pm Post subject: total newbie - subdirectories structure |
|
|
Could somebody tell me how structure a smarty web site having folders.
so far I have:
/index.php
/templates/
/templates_c/
/cache/
/configs/
I want to create a folder called "admin".
Does it mean I have to create
/templates
/templates_c
/cache
/configs
in the 'admin' folder?
cheers |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
quali74 Smarty Rookie
Joined: 09 May 2006 Posts: 10
|
Posted: Wed May 10, 2006 2:38 pm Post subject: |
|
|
it does not work.
I created the following
index.php
admin/page1.php
templates/admin/page1.tpl
templates_c/admin/
and I get :Warning: Smarty error: unable to read resource: "admin/page1.tpl" in D:\www\smarty_quickform\includes\classes\smarty-2.6.13\libs\Smarty.class.php on line 1095
so I changed this to
admin/page1.php
admin/templates/page1.tpl
admin/templates_c
and it works fine but it is not what I really want. How do I get the admin/ templates to call the other templates |
|
Back to top |
|
nikotto Smarty Rookie
Joined: 12 Jan 2004 Posts: 26
|
Posted: Wed May 10, 2006 2:54 pm Post subject: |
|
|
you can always define the path to your templates, in admin/page1.php you could use
$smarty->template_dir = '../templates/'; |
|
Back to top |
|
quali74 Smarty Rookie
Joined: 09 May 2006 Posts: 10
|
Posted: Wed May 10, 2006 2:57 pm Post subject: |
|
|
All the examples and tutorials I can see have no subfolders. Why is that?
I need to understand how a templates folders communicate with each others... |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 10, 2006 3:52 pm Post subject: |
|
|
Avoid using relative folder paths in your Smarty setup. Instead, use absolute paths that are rooted to your webroot path. Recall, relative file references to /foo/bar.php are different than those to /bar.php -- so if you are using the same code/relative paths, you will NOT be pointing to the same resource locations (eg templates, compiled, cache, config) under both. This has been covered a lot, so perhaps try a search of the forums.
Good luck. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|