Jump to content

can't understand this


runeveryday

Recommended Posts

This is the easiest way to install Smarty. The point is that you need to load the Smarty.class.php file in every PHP file that uses Smarty templates, so if you have it in one folder of the PHP include path, you can create a Smarty instance for it by:

<?php 
require('Smarty.class.php'); 
$smarty = new Smarty; 
?>

can't catch up with this part"so if you have it in one folder of the PHP include path, you can create a Smarty instance for it by:..."

anyone can explain it for me?thank you

Link to comment
https://forums.phpfreaks.com/topic/207914-cant-understand-this/
Share on other sites

What is there to explain? If the 'Smarty.class.php' file is within a directory which is on your include_path the above code will include it into your code.

 

Do you know what the include_path is?

 

Take a look at set_include_path & get_include_path.

 

the include path is where you should put any libraries so they are easy to include.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.