So we have done the following in our previous lessons.
Remember the functions.php in the 'main' directory!!
Let us define some functions in 'functions.php'.
The functions are described below
- setup xampp!
- created 'stupid' database with essential tables.
- coded all the essential classes (database,theme).
- completed our engine.php script.
Remember the functions.php in the 'main' directory!!
Let us define some functions in 'functions.php'.
- Open the file in an editor and write the following code.
/*************************** Shows the title of the page ****************************/ function title($title) { echo '<title>'.SITENAME.' : '.$title.'</title>'; } /*************************** if your module has title use this function to show title of app inside app block ****************************/ function app_title($app_title) { echo '<div id="app_title">'.$app_title.'</div>'; echo '<div id="spacer"></div>'; } /*********************************** get site logo ***************************************/ function get_site_logo() { global $theme; return $theme->get_sitelogo(); }
The functions are described below
- title ==> TO DEFINE THE TITLE OF A PAGE.
- app_title ==> TO DEFINE THE TITLE OF APP.
- get_site_logo ==> RETURNS THE SITELOGO.
Now its time to create our first theme 'default'.
Please download the code and extract it into 'themes' folder.
Now open the 'index.php' in the stupid folder.
Include our 'engine.php' there.
<div id="container"> <div id="wrapper"> <?php require 'main/engine.php'; ?> </div> </div>
After doing all these,run xampp.
Go to http://localhost/stupid/ from your browser.
If all came in our way,you will see a congratulation message.Otherwise please comment here so that I can understand the details of the error.
<<< PREVIOUS || NEXT >>>