Announcement

Collapse
No announcement yet.

Classes...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Classes...

    ok i built a class for formating my messages..

    PHP Code:

    class Text
    {
        var 
    $Font;
        var 
    $Size;
        var 
    $Color;
        var 
    $Mstring;
        
        function 
    Text($font$size$color$mstring) {
            
            
    $this->Font $font;
            
    $this->Size $size;
            
    $this->Color $color;
            
    $this->Mstring $mstring;
        }
        
        function 
    BuildText(){
            
    $stringblah "<font face=\"$this->Font\" size=\"$this->Size\" color=\"$this->Color\">$this->mstring</font>";
            
            return 
    $stringblah;
        
        }

    and.. this to call it..

    PHP Code:
    include("classes.php");

    $f "verdana";
    $sz "1";
    $col "red";
    $msg "bafasddsfds";

    $blank = new Text($f$sz$col$msg);

    $message "<b>" $blank->BuildText() . "</b>";

    echo 
    $message
    it adds all the font tags and everything but it wont echo the message too :\. Any ideas how to fix this?

  • #2
    fixed it . case sensitive stuff isnt cool :\.

    i had .. $this->mstring.. and it should have been.. $this->Mstring

    Comment


    • #3
      It's so much easier to just do things all lowcase

      Comment


      • #4
        http://<a href="http://www.wee.com" ...ww.wee.com</a>
        Last edited by justtesting343; Sat 16th Mar '02, 9:58am.

        Comment

        Loading...
        Working...
        X