View previous topic :: View next topic |
Author |
Message |
JCianflone Smarty Rookie
Joined: 18 Jul 2006 Posts: 6
|
Posted: Mon Jul 31, 2006 3:32 pm Post subject: config not loading |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jul 31, 2006 3:42 pm Post subject: Re: config not loading |
|
|
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 |
|
JCianflone Smarty Rookie
Joined: 18 Jul 2006 Posts: 6
|
Posted: Mon Jul 31, 2006 7:22 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jul 31, 2006 7:42 pm Post subject: |
|
|
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 |
|
JCianflone Smarty Rookie
Joined: 18 Jul 2006 Posts: 6
|
Posted: Mon Jul 31, 2006 7:58 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jul 31, 2006 8:19 pm Post subject: |
|
|
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 |
|
JCianflone Smarty Rookie
Joined: 18 Jul 2006 Posts: 6
|
Posted: Mon Jul 31, 2006 9:42 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jul 31, 2006 11:51 pm Post subject: |
|
|
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 |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
Posted: Tue Aug 01, 2006 7:13 am Post subject: |
|
|
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 |
|
spunkymungbeans Smarty Regular
Joined: 14 Mar 2005 Posts: 49
|
Posted: Fri Aug 18, 2006 6:00 am Post subject: |
|
|
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 |
|
Pap Smarty Regular
Joined: 21 Jun 2006 Posts: 69 Location: Denver, CO
|
Posted: Fri Aug 18, 2006 6:33 am Post subject: |
|
|
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 |
|
|