|
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 |
Enquest Smarty Regular
Joined: 14 May 2003 Posts: 79
|
Posted: Tue Oct 14, 2003 11:00 am Post subject: Code practise: require_once |
|
|
As I'm always learning I was wondering about the following code practise.
When I make a site with smarty I have a central setup.php file. Each page I make is refering to this page.
I also luve to use classes. As we al know you need to initiate a class.
My question is: is it wise to but this in al the classes via required_once('class1.php') in the setup.php. And $class = new class($db);... in the setup.php
Doesn't it make the site slower the more classes you have? For example 10, 20 classes...
Doesn't it make this smarty slower?
What would be the correct code practise for this. _________________ -----------------------
Learning my self by trying to help others |
|
Back to top |
|
inerte Smarty Rookie
Joined: 24 Sep 2003 Posts: 9
|
Posted: Fri Oct 17, 2003 6:02 pm Post subject: |
|
|
Yes, it make PHP slower to require a lot of files.
Usually what I do is require only widely used classes on the central file, and smaller parts where they are needed. |
|
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
|