Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

How to reference SETUP.php from a extended folder

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
NewfieBilko
Smarty Regular


Joined: 21 Jun 2004
Posts: 41

PostPosted: Fri Jul 16, 2004 12:36 pm    Post subject: How to reference SETUP.php from a extended folder Reply with quote

Hey guys.. Using smarty.. I have all my setup files in the /root, if i wanted to make say an admin section, seperate from the root, say in folder root/admin, and had files in there, how can i reference the setup.php in the precending folder.

I say in my admin.php:

[php:1:f459160867]<?php
require_once '../setup.php';
?>[/php:1:f459160867]

??????
this does not work
Back to top
View user's profile Send private message
NewfieBilko
Smarty Regular


Joined: 21 Jun 2004
Posts: 41

PostPosted: Fri Jul 16, 2004 1:15 pm    Post subject: Reply with quote

ok ../smarty does work, but when i go any further (put templates in the admin folder), and set it up, the application is still trying to reference as if everything is in the admin folder, which is not, example:

Failed opening required 'Smarty/Smarty_Compiler.class.php' (include_path='.:/usr/share/pear') in /var/www/php2/Smarty/Smarty.class.php on line 1009
Back to top
View user's profile Send private message
NewfieBilko
Smarty Regular


Joined: 21 Jun 2004
Posts: 41

PostPosted: Mon Jul 19, 2004 3:39 am    Post subject: Reply with quote

The refence will load the setup file, but then the admin.php will try and call everything as if the setup was in the admin/ folder, like it will load lang files from /admin/lang when they are in the httd/land.. Simple problem but a confusing thing to find out.
Back to top
View user's profile Send private message
NewfieBilko
Smarty Regular


Joined: 21 Jun 2004
Posts: 41

PostPosted: Mon Jul 19, 2004 3:39 am    Post subject: Reply with quote

Help!
Back to top
View user's profile Send private message
mensi
Smarty n00b


Joined: 29 Jun 2004
Posts: 4
Location: Switzerland -> Zug

PostPosted: Thu Jul 22, 2004 12:46 am    Post subject: Reply with quote

Try using absolute paths

If you want to do so without knowing the base dir you can do it this way:
include dirname(__FILE__).'/realtive/path/to/file.php';

And here a further hint for you
Remember that we aren't in a real life conversation so nobody is deaf here ergo: you do not have to write things several times... They get through the first time...
_________________
kernel, n.: A part of an operating system that preserves the medieval traditions of sorcery and black art.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jul 22, 2004 1:16 am    Post subject: Reply with quote

@NewfieBilko: try this thread -- http://www.phpinsider.com/smarty-forum/viewtopic.php?t=1268

@mensi: yeah, shout outs can be tiresome but sometimes it helps get some traction. Squeaky wheel and all that. Besides, if NewfieBilko is really a newfie, then I am sure it is intended in the best of spirits and charm.
Back to top
View user's profile Send private message
NewfieBilko
Smarty Regular


Joined: 21 Jun 2004
Posts: 41

PostPosted: Tue Jul 27, 2004 4:29 pm    Post subject: Reply with quote

LOL Ya knows it brotha, Hell ya, straight outta st. johns city, and if i could help people on this more, i would, but for I am still learning Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP