I am trying to create an object to modify its colour, size, message attributes on the fly using OOP concept...
Everything works fine with this code but the problem is the font size is not changing. I have highlighted the problem area in the below snippet.
// Start of the Snippet
-------------------------------
Expand|Select|Wrap|Line Numbers
- class theme{
- var $fontColour;
- var $fontSize;
- var $amessage;
- function __construct($fontColour,$fontSize){ // attribute intialization
- $this->fontColour=$fontColour;
- $this->fontSize=$fontSize;
- }
- function accessMessageFetch() { // amessage attrirbute fetching from file
- $fd=fopen("includes/amessage.inc", "r+") or die ("Can't open the file amessage.inc");
- $fstring =fread($fd, filesize("includes/amessage.inc"));
- $this->amessage=$fstring;
- fclose($fd);
- }
- function accessDisp(){ // display function
- /*************************************************
- * Problem Area:
- *************************************************/
- echo "<span><font color=/'".$this->fontColour."/' size=/'".$this->fontSize."/'>".$this->amessage."</font></span>"; // Problem area
- }
- } // end of class
- $themeSetting=new theme('#3671AD',+2);
- $themeSetting->accessMessageFetch();
- $themeSetting->accessDisp();
Please advice...