Welcome Guest, Not a member yet? Register   Sign In
Model Code error
#11

[eluser]Tom Schlick[/eluser]
are you getting any error messages at all? do you have error reporting turned on? did u make sure to put the parent::Model(); in your contructor...
#12

[eluser]jdfwarrior[/eluser]
He came in to ask one simple question and now we're all slaughtering his code and critiquing his style hehe.

Question still remains... are you sure that $this->round has a value, and better yet is it one that would match the given conditions?
#13

[eluser]Evil Wizard[/eluser]
I wouldn't say he's having his code slaughtered, i just rewrote it to be slightly more efficient and removed unneccasary code duplication, i should have added a "default" to the switch though, something like

Code:
default:
    var_dump($this->round);
break;

also, I don't comment inside the function unless it's very complex line(s), doxegen and javadoc style comment extracters don't gather them. and I guess we all started with our own "hello world" code at some point (!) lol
#14

[eluser]stuffradio[/eluser]
Quote:are you getting any error messages at all? do you have error reporting turned on
No and yes.
Quote:did u make sure to put the parent::Model(); in your contructor…
Yes...

Quote:First thing I see that is wrong is a total lack of commenting in your code Sad
I usually only comment in libraries that I write.

I will try removing the if statements later.
#15

[eluser]jdfwarrior[/eluser]
You still fail to tell us whether or not you have confirmed that you have a suitable value set to $this->round.




Theme © iAndrew 2016 - Forum software by © MyBB