Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Problem with class constructor
- Charles Russell
November 14, 2004, 11:23 am
rate this thread
line. To achieve this I use the day and line number as part of the
name. Given my code I would expect that I would get something like
<label for='hrs'>Hours<input type='text' name='hrs1_1' style='width:2em'
/></label>. My result is <label for='hrs'>Hours<input type='text'
name='hrs_' style='width:2em' /></label> as you can see the name
attribute does not have the variable portion. I can see that the
parameters passed are comming in to the constructor correctly but the
member variables of my class are not being set. I can't see why, it
must be something real simple.
I have declared the class as follows:
//End Debug code
if ($sheet != "none")
if($day > 6)
echo "There are only 7 days in a week";
//member variable should be set here
//End Debugg code
//echo "Blank detail line<br />";
echo "<label for='hrs'>Hours";
echo "<input type='text' name='$widgitName; style='width:2em' />";
echo"</label> <br />";
Re: Problem with class constructor
Don't forget that variable names are case sensitive. This test will not
trigger when $Day > 6; the code will also produce a warning when
error_reporting is set to E_ALL.
You're still in the first if() block, so if you didn't pass a non-"none"
$sheet parameter, this will never be executed and your member variables
will never be set.
I do, however, get the expected results with your code when passing a
$foo = new clsBlnkDetail( 1, 1, 'notblank' );
-- brion vibber (brion @ pobox.com)