Eugeny89
Eugeny89

Reputation: 3731

Naming php files: what do 'class.php' and 'html.php' extension mean?

Just curious, I've noticed that some php files have extension 'class.php' or 'html.php'. What is the reason for a code file to have such extensions?

Thank you in advance!!

Upvotes: 0

Views: 337

Answers (6)

oezi
oezi

Reputation: 51797

this doesn't have any special effect, as the real extension is still just .php. one might choose to name files like this to seperate views and models or something like that - but you could also use subfolders (named html and class for example) or don't use any kind of naming convention at all (wich might end up in a very confusing file-structure.)

Upvotes: 0

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

Depends on creation, it might mean like:

  • "class.php" => refers to class files like somethis.class.php
  • ".html.php" => refers to some templates like something.html.php

Upvotes: 1

Blake
Blake

Reputation: 2314

Having files with .php are executed by the PHP engine. Some people like to use periods as extensions of their uses.

ie create.my.template.html.php

create.my.template.html is the file name. .php is the extension.

Upvotes: 0

ThiefMaster
ThiefMaster

Reputation: 318468

It has no specific meaning. Most likely .class.php contains a classe and .html.php could be a template.

Using ClassName.class.php has the advantage that you can safely use autoloading to include $className.'.class.php' in the __autoload() function without possible conflicts (e.g. with a class named index - you most likely have an index.php but that class' file would be index.class.php so it would not be a problem).

Upvotes: 0

Salil Momin
Salil Momin

Reputation: 361

Yes, class.php are models/handlers and html.php are views

Upvotes: 0

Reza S
Reza S

Reputation: 9738

It must be a custom thing, maybe class.php extensions are "models" and html.php files are "views"

Upvotes: 2

Related Questions