Cc: PHP-General List
Subject: Re: [PHP] how to say inverse your value (to a boolean)?
John Butler wrote:
quick Q:
I have this inside a foreach{} that I want to alternate
between on and
off so I can alternate the background-color of my tr's.
$tableRowBGcolorBoolCounter
At 8:33 AM -0700 8/12/09, Jim Lucas wrote:
Daevid Vincent wrote:
-snip-
I side with Jim on this. I never use short tags and write similar crap.
Jim said:
I have found, in a number of cases, that using only the TR tag
doesn't work all the time.
It should work ALL the time, but sometimes
thats why I decided years ago to write myself a little bunch of classes for
the html tags which gives me the ability to have PHP only code, very nice,
no errors and my outputs dont even need Tidy pure XHTML
i find these idear of mixing html and php as spagetty, using divs for tables
as something
-Original Message-
From: Daevid Vincent [mailto:dae...@daevid.com]
Sent: 11 August 2009 02:19
Then YOU have more aggressive error_reporting than the default
setting
turned on. You might consider turning it down a notch. NOTICEs are
basically
useless and bloat your code IMHO --
2009/8/11 Daevid Vincent dae...@daevid.com:
NO! For the love of God and all that is holy, don't do that accumulator /
mod hack.
That's so 1980's. And why make the CPU do all that math for every row...
Just do this. It's quick and simple:
CSS:
.dataRow1 { background-color:
On Tue, 2009-08-11 at 11:28 +0100, David Otton wrote:
2009/8/11 Daevid Vincent dae...@daevid.com:
NO! For the love of God and all that is holy, don't do that accumulator /
mod hack.
That's so 1980's. And why make the CPU do all that math for every row...
Just do this. It's quick
seems they changing idears on the fly? could it be that the designer is a
smal ugly person while u a a good looking ladykiller ?
on that background I would design a function where u can change ti what ever
u want on the fly something like this
var $a;
function alternate( $a, $_b=array( red, red
and books, but can't remember (nor find now)
in PHP how to say inverse your value (to a boolean).
?
TIA! -G
John:
Here's my solution:
http://webbytedd.com/b/color-rows/
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List
on and off
I am looking thru' docs and books, but can't remember (nor find
now) in PHP how to say inverse your value (to a boolean).
?
TIA! -G
John:
Here's my solution:
http://webbytedd.com/b/color-rows/
Cheers,
tedd
However, my solution (after reading others) is for an alternating row
.
$tableRowBGcolorBoolCounter != $tableRowBGcolorBoolCounter; //-boolean on
and off
I am looking thru' docs and books, but can't remember (nor find now) in
PHP how to say inverse your value (to a boolean).
?
TIA! -G
John:
Here's my solution:
http://webbytedd.com/b/color-rows/
Cheers
)
in
PHP how to say inverse your value (to a boolean).
?
TIA! -G
If I was going to do that then I would use jQuery:
script type=text/javascript
$(document).ready(function(){
$(table tr:even).addClass(even);;
$(table tr:odd).addClass(odd);;
});
/script
And yes I know
and books, but can't remember (nor find now) in
PHP how to say inverse your value (to a boolean).
?
TIA! -G
If I was going to do that then I would use jQuery:
script type=text/javascript
$(document).ready(function(){
$(table tr:even).addClass(even);;
$(table tr:odd).addClass(odd
At 10:27 AM -0300 8/11/09, Martin Scotta wrote:
A change request just came in - the interaction designer wants every
third line to have a grey background, instead of every second line.
# before was $styles = array( 'even', 'odd' );
# after new requirements it is...
$styles = array( 'white',
# before was $styles = array( 'even', 'odd' );
# after new requirements it is...
$styles = array( 'white', 'white', 'gray' );
foreach($items as $item)
{
printf( 'li class=%s%s/li', current( $styles ), $item );
next( $styles ) or reset( $styles );
}
+5000. I think is by far the most
Ben Dunlap wrote:
# before was $styles = array( 'even', 'odd' );
# after new requirements it is...
$styles = array( 'white', 'white', 'gray' );
foreach($items as $item)
{
printf( 'li class=%s%s/li', current( $styles ), $item );
next( $styles ) or reset( $styles );
}
+5000. I think is by far
# before was $styles = array( 'even', 'odd' );
# after new requirements it is...
$styles = array( 'white', 'white', 'gray' );
foreach($items as $item)
{
printf( 'li class=%s%s/li', current( $styles ), $item );
next( $styles ) or reset( $styles );
}
+5000. I think is by far the most
What a lot of good ideas spawned from the OP!
I am learning many things,.. while also actually working (paying
bills), so I regularly have to just go with what I know well.
Anyway, I already have the forearch { loop (for other reasons it is
necessary), and I only needed one color to
At 1:53 PM -0600 8/11/09, John Butler wrote:
What a lot of good ideas spawned from the OP!
I am learning many things,.. while also actually working (paying
bills), so I regularly have to just go with what I know well.
Anyway, I already have the forearch { loop (for other reasons it is
What a lot of good ideas spawned from the OP!
I am learning many things,.. while also actually working (paying
bills), so I regularly have to just go with what I know well.
Anyway, I already have the forearch { loop (for other reasons it is
necessary), and I only needed one color to
John Butler wrote:
What a lot of good ideas spawned from the OP!
I am learning many things,.. while also actually working (paying
bills), so I regularly have to just go with what I know well.
Anyway, I already have the forearch { loop (for other reasons it is
necessary), and I only needed
He's pointing out a typo... forearch instead of foreach :)
LOL!
I almost always miss the jokes.
Thanks for the smiley face to get my (lighter) attention ;-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
thru' docs and books, but can't remember (nor
find now) in
PHP how to say inverse your value (to a boolean).
?
TIA! -G
?php
$arr = range(1, 10);
$i = 0;
foreach ( $arr AS $row ) {
$row_color = ( ( $i++ % 2 ) ? 'green' : 'red');
echo $row_color
)
in PHP how to say inverse your value (to a boolean).
?
TIA! -G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
{} that I want to alternate between on and off
so I can alternate the background-color of my tr's.
$tableRowBGcolorBoolCounter != $tableRowBGcolorBoolCounter; //-boolean on
and off
I am looking thru' docs and books, but can't remember (nor find now) in PHP
how to say inverse your value
: Jim Lucas [mailto:li...@cmsws.com]
Sent: Monday, August 10, 2009 4:03 PM
To: John Butler
Cc: PHP-General List
Subject: Re: [PHP] how to say inverse your value (to a boolean)?
John Butler wrote:
quick Q:
I have this inside a foreach{} that I want to alternate
between on and
off so
[mailto:li...@cmsws.com]
Sent: Monday, August 10, 2009 4:03 PM
To: John Butler
Cc: PHP-General List
Subject: Re: [PHP] how to say inverse your value (to a boolean)?
John Butler wrote:
quick Q:
I have this inside a foreach{} that I want to alternate
between on and
off so I can
.
-Original Message-
From: Martin Scotta [mailto:martinsco...@gmail.com]
Sent: Monday, August 10, 2009 5:39 PM
To: Daevid Vincent
Cc: PHP-General List
Subject: Re: [PHP] how to say inverse your value (to a boolean)?
Use...
$dr = !$dr
if you want
Notice: Undefined variable: dr
All
On Mon, Aug 10, 2009 at 04:18:29PM -0700, Daevid Vincent wrote:
NO! For the love of God and all that is holy, don't do that accumulator /
mod hack.
That's so 1980's. And why make the CPU do all that math for every row...
Just do this. It's quick and simple:
CSS:
.dataRow1 {
-
From: Jim Lucas [mailto:li...@cmsws.com]
Sent: Monday, August 10, 2009 4:03 PM
To: John Butler
Cc: PHP-General List
Subject: Re: [PHP] how to say inverse your value (to a boolean)?
John Butler wrote:
quick Q:
I have this inside a foreach{} that I want to alternate
between on and
off so I can
29 matches
Mail list logo