|
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 |
AlexPotapov Smarty n00b
Joined: 21 Sep 2011 Posts: 1
|
Posted: Wed Sep 21, 2011 6:40 am Post subject: Problem with link to css file |
|
|
Hi guys.
Thats my php-code:
Code: | if(isset($_GET['c']) AND !empty($_GET['c'])){ $c = $_GET['c'];}else{ $c = "site";}
if(isset($_GET['m']) AND !empty($_GET['m'])){ $m = $_GET['m'];}else{ $m = "index";}
...
$controller = $c."Controller.php";
$className = $c."Controller";
require("../application/controllers/".$controller);
$class = new $className;
$output = $class->$m($params); |
And thats what i get after executing it (line 52 is "require(...)"):
[19-Sep-2011 20:48:31] PHP Warning: require(../application/controllers/htdocs/styleController.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /Applications/MAMP/framework/frameworkStandart.php on line 52
[19-Sep-2011 20:48:31] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '../application/controllers/htdocs/styleController.php' (include_path='.:/Applications/MAMP/bin/php5.3/lib/php') in /Applications/MAMP/framework/frameworkStandart.php on line 52
And thats is link from my template to the CSS-file:
<link rel="stylesheet" type="text/css" href="../../htdocs/style/styleSite.css">
Looks like that $controller variable changes somehow its value to the value of this href="", but when i write echo($controller) before or after require-statement it shows me right value (for example "siteController.php").
Maybe someone has an idea how is it possible and how can i fix it? |
|
Back to top |
|
waro Smarty Regular
Joined: 12 Jun 2008 Posts: 38
|
Posted: Wed Sep 21, 2011 10:46 pm Post subject: |
|
|
I'm just guessing here, try to fix this line:
Code: | require("../application/controllers/".$controller); |
You might be forgot to add the trailing slash or put wrong directory there. |
|
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
|