1
I have a class called Setup with some static methods. But I’m having trouble understanding something that happens.
I use the class methods as follows: Setup::$getMetodoX
so far so good. However to facilitate its use and not have to include the class in several pages, I make a include of this class in my HEAD
.
But looking at the head
I noticed the following line of code: $setup = new Setup();
. So I decided to remove this line, since I know that a class of static methods should not receive an instantiation through the new
of PHP.
But to my surprise. By removing this line my system loses its style (css). However, this variable $setup
that instance my class is not used anywhere in my project.
So I’d like to understand if this new
PHP has some other function besides instantiating a class?
You’ve seen what errors/warnings PHP gives. It’s that not appearing style can indicate an error in PHP. Have you seen the browser console if css is being loaded?
– Jorge B.
No error occurs, neither Warning in PHP. but when I comment on the quoted line all js and css files generate error in loading. My page loads normal but without style. But without PHP error messages, it is difficult to understand what might be happening.
– alan
It is because you must have something that indicates the path of the files in that class. You have already checked what you have in the constructor?
– Jorge B.