Re: [PHP-DB] Help in concatenation

2008-06-07 Thread Nitsan Bin-Nun
1.
a class=?php print($class);? href=?php
print($thispage.($y0?(?start=).$y:));??php
print($pg);?/a
2.  a href=?php print($thispage.($next0?(?start=).$next:));?/a

turns into:


 ?php
 $string = 'a class=' . $class . ' href=' . $thispage;
 if ($y  0) $string .= \$start= . $y;
 $string .= '' . $pg . '/a';
 ?






 ?php
 $string2 = 'a href=' . $thispage;
 if ($next  0) $string2 .= '?start=' . $next;
 $string2 .= '/a';
 ?

I can squeeze the if operation into the string but I can't see good cause
for this (this is less spageti this way)
On 06/06/2008, Nasreen Laghari [EMAIL PROTECTED] wrote:

 Hi,

 I need to change PHP embeded in HTML to HTML embeded in PHP as trying to
 use modularity approach.
 I'm stuck on below these lines where concatenation is the big issue. I have
 researched, read but couldnt sort this out after try really hard.
 Could any one please help me to change this code to HTML embeded in PHP
 please. Mostly i'm getting confuse where text is written in red
 I know it is very basic question but this concatenation is confusing me so
 much. I have spended my whole day in sorting this out but :(
 1. a class=?php print($class);? href=?php
 print($thispage.($y0?(?start=).$y:));??php print($pg);?/a
 2.  a href=?php
 print($thispage.($next0?(?start=).$next:));?/a
 Thank you





Re: [PHP-DB] Help in concatenation - modular development

2008-06-07 Thread YVES SUCAET
If you want to go for a modular approach, you should consider switching to a
solution such as Smarty: http://www.smarty.net for more info.

HTH,

Yves

-- Original Message --
Received: Sat, 07 Jun 2008 11:55:38 AM CDT
From: Nitsan Bin-Nun [EMAIL PROTECTED]
To: Nasreen Laghari [EMAIL PROTECTED]Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Help in concatenation

1.
a class=?php print($class);? href=?php
print($thispage.($y0?(?start=).$y:));??php
print($pg);?/a
2.  a href=?php
print($thispage.($next0?(?start=).$next:));?/a

turns into:


 ?php
 $string = 'a class=' . $class . ' href=' . $thispage;
 if ($y  0) $string .= \$start= . $y;
 $string .= '' . $pg . '/a';
 ?






 ?php
 $string2 = 'a href=' . $thispage;
 if ($next  0) $string2 .= '?start=' . $next;
 $string2 .= '/a';
 ?

I can squeeze the if operation into the string but I can't see good cause
for this (this is less spageti this way)
On 06/06/2008, Nasreen Laghari [EMAIL PROTECTED] wrote:

 Hi,

 I need to change PHP embeded in HTML to HTML embeded in PHP as trying to
 use modularity approach.
 I'm stuck on below these lines where concatenation is the big issue. I have
 researched, read but couldnt sort this out after try really hard.
 Could any one please help me to change this code to HTML embeded in PHP
 please. Mostly i'm getting confuse where text is written in red
 I know it is very basic question but this concatenation is confusing me so
 much. I have spended my whole day in sorting this out but :(
 1. a class=?php print($class);? href=?php
 print($thispage.($y0?(?start=).$y:));??php print($pg);?/a
 2.  a href=?php
 print($thispage.($next0?(?start=).$next:));?/a
 Thank you








--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Help in concatenation

2008-06-06 Thread Nasreen Laghari
Hi,
 
I need to change PHP embeded in HTML to HTML embeded in PHP as trying to use 
modularity approach.
I'm stuck on below these lines where concatenation is the big issue. I have 
researched, read but couldnt sort this out after try really hard.
Could any one please help me to change this code to HTML embeded in PHP please. 
Mostly i'm getting confuse where text is written in red
I know it is very basic question but this concatenation is confusing me so 
much. I have spended my whole day in sorting this out but :(
1. 
a class=?php print($class);? href=?php print($thispage.($y0?(?start=).$y:));??php print($pg);?/a
2.  a href=?php print($thispage.($next0?(?start=).$next:));?/a 
Thank you