Last active
August 29, 2015 14:07
-
-
Save jeffreyroberts/f330ad4a164adda221aa to your computer and use it in GitHub Desktop.
PHP Vars not being passed from bootstrap to view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: jlroberts | |
* Date: 10/18/14 | |
* Time: 12:42 PM | |
*/ | |
define('JLR_ROOT', '/vagrant/web'); | |
$siteName = "Jeff's Site"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "bootstrap.php"; | |
include "views.php"; | |
JLR_Core_Views::loadView("index"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: jlroberts | |
* Date: 10/18/14 | |
* Time: 12:43 PM | |
*/ | |
echo $siteName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JLR_Core_Views { | |
public static function loadView($templateName) { | |
$templatePath = JLR_ROOT . '/webroot/' . $templateName . '.tpl'; | |
if(file_exists($templatePath)) { | |
include_once $templatePath; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notice: Undefined variable: siteName in /vagrant/web/webroot/index.tpl on line 9
lol