Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

config not loading

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
JCianflone
Smarty Rookie


Joined: 18 Jul 2006
Posts: 6

PostPosted: Mon Jul 31, 2006 3:32 pm    Post subject: config not loading Reply with quote

Hello,
I am really not sure what is going on here and I dont know why my code isnt working. Hope someone can help me out. We set up our config directories to
point to:
Code:

 /var/www/html/presentaiton/config


then I call the config file:
Code:

{config_load file="general.conf"}


then I call the var i need:

Code:

{$Smary.config.styles}


the output is nothing. Blank. Nada.

Help?
_________________
Joe C
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Jul 31, 2006 3:42 pm    Post subject: Re: config not loading Reply with quote

JCianflone wrote:

Code:

{$Smary.config.styles}


the output is nothing. Blank. Nada.

Help?


Hi.

Be more dilligent with your spelling and more careful with your reading of the manual (both spelling and casing matter):

{$smarty.config.styles}

Cheers!
Back to top
View user's profile Send private message
JCianflone
Smarty Rookie


Joined: 18 Jul 2006
Posts: 6

PostPosted: Mon Jul 31, 2006 7:22 pm    Post subject: Reply with quote

Actually, that was just a spelling error on the boards. In my actualy file, everything is spelled correctly. Any other ideas?


could this have something to do with my directory structure?
presentations/config/general.conf --> location of my config file
presentations/tpl/page.tpl --> location of my TPL

business/index.php --> location of actual PHP page


could that be screwing something up??
_________________
Joe C
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Jul 31, 2006 7:42 pm    Post subject: Reply with quote

Can you cut and paste your actual code, please? Debugging via re-types and descriptions (both of which may be inaccurate) is really not ideal.

BTW: make sure you have error reporting set to E_ALL and that you are displaying errors.
Back to top
View user's profile Send private message
JCianflone
Smarty Rookie


Joined: 18 Jul 2006
Posts: 6

PostPosted: Mon Jul 31, 2006 7:58 pm    Post subject: Reply with quote

config file
Code:

styles = "http://myserver.com/twain/presentationLayer/styles/"


TPL
Code:

{config_load file="general.conf"}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   
      {include file="./include/documentHeader.tpl" pageTitle="Login to LiveProcess"}
      <link rel="stylesheet" type="text/css" href="{$smarty.config.styles}login/login.css" />
   </head>
   <body class="pageBody">
   
      {include file="./include/headerWithTabs.tpl"}
   
      {include file="./login/loginMain.tpl"}
         
      {include file="./include/footer.tpl"}
      {$smarty.config.styles} {* Styles? *}
   </body>
</html>


The whole page comes up. Just minus the styles that come from login.css and that call to the config var right before the end of the body comes up blank
_________________
Joe C
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Jul 31, 2006 8:19 pm    Post subject: Reply with quote

Sounds like you aren't loading the config file at all.

"/var/www/html/presentaiton/config" you mentioned and "presentations/config/general.conf" -- which is inconsistent (but maybe another transcription issue?). Smarty complains when it can't load/find a resource. Please ensure error reporting is turned on.

[php:1:03d73dcf8b]error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
[/php:1:03d73dcf8b]
Back to top
View user's profile Send private message
JCianflone
Smarty Rookie


Joined: 18 Jul 2006
Posts: 6

PostPosted: Mon Jul 31, 2006 9:42 pm    Post subject: Reply with quote

cant report errors. legacy code in place, will mess up some stuff on our live servers then i will have some serious issues. as for what i said before regarding directories...all directories match, naming conventions are all the same, no spelling errors.

Smarty code is being written in a different directory, outside of where the TPL's are kept and outside of where the config files are. Could that be an issue?

example:

/main/smarty/businessCode/index.php
/main/templates/presentationLayer/config/general.conf

is that OK?
_________________
Joe C
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Jul 31, 2006 11:51 pm    Post subject: Reply with quote

Sorry, I can't help debug hypothetical's. Maybe someone else will be able to pick this thread up and help you some.

Best of luck.
Back to top
View user's profile Send private message
shannera
Administrator


Joined: 13 Feb 2006
Posts: 802
Location: Edertal, Germany

PostPosted: Tue Aug 01, 2006 7:13 am    Post subject: Reply with quote

You can indeed report errors, if you place the "activate the damn error reporting" code provided by boots in an if clause that only evaluated to true for a specific ip adress, in your case the actual adress used by yourself.
On the other hand, the code snippet provided by boots only applies to the actual php script, so there isn't really a possibility that error reporting will automagically go on on every other site on the server.
Without any error reporting, don't expect to get any further help, as most here don't have a working crystal orb.
Back to top
View user's profile Send private message
spunkymungbeans
Smarty Regular


Joined: 14 Mar 2005
Posts: 49

PostPosted: Fri Aug 18, 2006 6:00 am    Post subject: Reply with quote

Just thought I should mention, I had the same problem - the config_load request was (I thought) failing without error. I discovered that because I had the config file divided into sections that it was only returning the global constants at the top of the file.

If you have a constant within a section you have to include the section name in the config_load call. I had assumed that not including the section name would load the entire file - wrong.
_________________
Leonie
Back to top
View user's profile Send private message
Pap
Smarty Regular


Joined: 21 Jun 2006
Posts: 69
Location: Denver, CO

PostPosted: Fri Aug 18, 2006 6:33 am    Post subject: Reply with quote

error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', 'error_log.txt');
_________________
Don't be stupid, be a Smarty™.
Come and join the P-H-Party.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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