Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Learnings


Guest

Recommended Posts

I am new at learning PHP but things are going smoothly. I have one request.

 

Okay I notice that the main index page in the /catalog/ directory has this code

 

<title><?php echo TITLE; ?></title>

 

Then you look at english.php located in catalog/includes/languages/

 

and you see this code

 

// page title
define('TITLE', 'Your Title Here');

 

Now where is the file that allows this connection to take place? Because obviously <?php echo TITLE; ?> is telling define('TITLE', 'Your Title Here'); to react by inserting Your Title Here as the page title. I just am curious where the file is that connects the 2. Can anyone help clear this haziness in my head?

Link to comment
Share on other sites

I am new at learning PHP but things are going smoothly. I have one request.

 

Okay I notice that the main index page in the /catalog/ directory has this code

 

<title><?php echo TITLE; ?></title>

 

Then you look at english.php located in catalog/includes/languages/

 

and you see this code

 

// page title
define('TITLE', 'Your Title Here');

 

Now where is the file that allows this connection to take place? Because obviously <?php echo TITLE; ?> is telling define('TITLE', 'Your Title Here'); to react by inserting Your Title Here as the page title. I just am curious where the file is that connects the 2. Can anyone help clear this haziness in my head?

 

As you will have noticed most pages have something like

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

Now you ask where does FILENAME_DEFAULTS getting filled in and for that you take a look in

(catalog)/includes/filenames.php (which is called upon in your includes/application_top.php)

You see that filename_default is equal to index.php and so this require tells to pull in the

(catalog)/includes/languages/<youreffectivelanguage>/index.php where you find the

TITLE define.

 

Hope this clarifies it a bit.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...