|
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 |
blockergroup Smarty n00b
Joined: 24 Mar 2016 Posts: 1
|
Posted: Thu Mar 24, 2016 9:49 pm Post subject: How to reference the Smarty 3 template engine |
|
|
Hello,
I recently changed servers and have run into a lot of problems.
on my old server in my PHP front-end config.inc file, the reference to the smarty directory path was:
define('SMARTY_DIR', '/usr/share/php/smarty3/');
On new server I do not have access to a /usr/share/php.... path.
I was told by a tech with the new server company that I should include the PHP library into my own website and reference the Smarty 3 template engine.
I have all the smarty files in a folder on the server with all my front-end php files but, i don't know how i should correctly write define('SMARTY_DIR', '/usr/share/php/smarty3/');
or how to reference the Smarty 3 template.
when i go to the domain name www.dessinsllcportal.com, i get a page of errors, which basically tell me Warning: include_once..... no such file or directory.
any help would be appreciated.
thank you.
B |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Mar 24, 2016 10:17 pm Post subject: |
|
|
Learn the power of Composer. |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Tue Mar 29, 2016 10:56 am Post subject: Re: How to reference the Smarty 3 template engine |
|
|
blockergroup wrote: |
I have all the smarty files in a folder on the server with all my front-end php files but, i don't know how i should correctly write define('SMARTY_DIR', '/usr/share/php/smarty3/');
or how to reference the Smarty 3 template.
|
Think system file path on your new server is different. Create a little script named path.php with
Code: | <?php
echo __DIR__;
?> |
inside and load this to the root folder for your website. After running that script with http://www.dessinsllcportal.com/path.php you will get an output which tells you the complete path to your website root so you can modify the line. Don't forget to delete this script after path check!
Or as alternative - modify the line like this
Code: | define('SMARTY_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . 'smarty3' . DIRECTORY_SEPARATOR); |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Mar 29, 2016 2:49 pm Post subject: |
|
|
Only ever use "DIRECTORY_SEPARATOR" to parse input data.
Always use "/" in your code, where you work internally.
Output may or may not require "DIRECTORY_SEPARATOR", but prefer to not use it, if you can. |
|
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
|