php-general Digest 9 Nov 2010 15:36:47 -0000 Issue 7029
Topics (messages 309389 through 309399):
Re: Template engines
309389 by: David McGlone
309390 by: Matt Giddings
309393 by: Paul M Foster
309394 by: Robert Cummings
309395 by: Peter Lind
309399 by: tedd
After parsing
309391 by: stacygt.comcast.net
309392 by: Tommy Pham
Basic question
309396 by: Tseveendorj Ochirlantuu
309398 by: Sharl.Jimh.Tsin
Re: Vermis The Issue Tracking System
309397 by: Mert Oztekin
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Mon, 2010-11-08 at 23:36 +0100, [email protected] wrote:
> On Mon, 8 Nov 2010 14:41:12 -0700
> "Hansen, Mike" <[email protected]> wrote:
>
> > I really like the idea of using a templating engine. Which one do you
> > use? Why? For those that don't use templating engines, why don't you
> > use them?
>
> PHP is in itself a template language and I find that the template
> engines just get in the way.
>
> Why learn a template language when you can just concentrate on PHP?
>
> Also you can easily become dependable on a third party template system
> which needs to be upgraded. You never know when such an upgrade is
> necessary for your system and when it might break something.
>
> I always use homemade template systems and try to keep things very
> simple. If designers are working on the project as well they almost
> always benefit from a little insight into PHP rather than having to
> learn some template language they can't use for anything else.
>
> IMHO - If you have to jump in and out of HTML and template syntax you
> might as well jump in and out of HTML and PHP.
There is truth to this, but for me, its helping me learn in a much
clearer way. I can't explain how or why, but it make me feel like
everything is neat and tidy and where it should be. Where PHP and HTML
mixed and mingled gives me the feeling that everything is a disaster.
--
Blessings,
David M.
--- End Message ---
--- Begin Message ---
On Mon, Nov 8, 2010 at 9:39 PM, David McGlone <[email protected]> wrote:
> On Mon, 2010-11-08 at 16:51 -0500, Steve Staples wrote:
> > On Mon, 2010-11-08 at 14:41 -0700, Hansen, Mike wrote:
> > > I really like the idea of using a templating engine. Which one do you
> use? Why? For those that don't use templating engines, why don't you use
> them?
> > >
> > >
> >
> > for the longest time, i didn't know about them, and was breaking in and
> > out of php, as well as didn't use ANY classes... then i was starting to
> > play with phpbb, and found out a little about templates... so i
> > "borrowed" the template engine from them for a personal project... and
> > was pretty impressed.
> >
> > then shortly after that, i got a job with a company who used smarty
> > templates... and was VERY impressed with them :) ever since then, i've
> > been using smarty, and have been very happy since.
> >
> > I dont know of any others out there, but that is mostly becuase i am
> > content with what smarty does for me (and prolly becuase i am too lazy
> > to change now ;) )
> >
> > all of my projects now consist of smarty, pear mdb2, phpmailer, jquery,
> > fpdf (if needed), and pchart (again, if needed). these are my personal
> > choices, and I have been happy with them so far ;)
>
> I agree 100%!! Everyone here pretty much knows how much I've ranted
> about smarty :-)
>
> IMHO it's smart to use smarty! ;-)
>
> --
> Blessings,
> David M.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I have to agree with David here. Smarty may be an added layer to the whole
mix, but it makes maintaining the template and application much simpler.
Much better than mixing html/php all together in a single file. That and a
single template is easily used in multiple applications if needed, ore in
multiple files within the same application. IMHO the benefits far out way
the negatives of using a template engine.
--- End Message ---
--- Begin Message ---
On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote:
> I really like the idea of using a templating engine. Which one do you
> use? Why? For those that don't use templating engines, why don't you
> use them?
>
Here's why I don't use a templating engine.
First, You're taking an embedded language and writing a templating
engine in it. Seriously?
Second, you're painting a single page, maybe 10-15K worth of
information, and you're dragging 100K of code around just to paint a
single page. Seriously?
Third, you're creating a page on the fly, thrashing the server's CPU in
order to generate a page which could be built statically, or at least
with minimally embedded PHP. Seriously?
Fourth, you could achieve the same end result with carefully crafted PHP
embedded in your static HTML file, with actually very little more work.
I know, everyone's heard this before. But just because you *can* do
something doesn't mean you *should*.
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
On 10-11-09 12:20 AM, Paul M Foster wrote:
On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote:
I really like the idea of using a templating engine. Which one do you
use? Why? For those that don't use templating engines, why don't you
use them?
Here's why I don't use a templating engine.
First, You're taking an embedded language and writing a templating
engine in it. Seriously?
Second, you're painting a single page, maybe 10-15K worth of
information, and you're dragging 100K of code around just to paint a
single page. Seriously?
Third, you're creating a page on the fly, thrashing the server's CPU in
order to generate a page which could be built statically, or at least
with minimally embedded PHP. Seriously?
Fourth, you could achieve the same end result with carefully crafted PHP
embedded in your static HTML file, with actually very little more work.
I know, everyone's heard this before. But just because you *can* do
something doesn't mean you *should*.
Aaaah, the great argument that uses a single brush to paint all template
engines into one corner because if you've used one, you've used them
all... Seriously?
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
On 9 November 2010 06:20, Paul M Foster <[email protected]> wrote:
> On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote:
>
>> I really like the idea of using a templating engine. Which one do you
>> use? Why? For those that don't use templating engines, why don't you
>> use them?
>>
>
> Here's why I don't use a templating engine.
>
> First, You're taking an embedded language and writing a templating
> engine in it. Seriously?
>
> Second, you're painting a single page, maybe 10-15K worth of
> information, and you're dragging 100K of code around just to paint a
> single page. Seriously?
>
> Third, you're creating a page on the fly, thrashing the server's CPU in
> order to generate a page which could be built statically, or at least
> with minimally embedded PHP. Seriously?
>
You assume that the OP will either make static pages (yet posts on the
PHP mailing list) or makes pages that aren't very dynamic in any
sense. Seriously?
--
<hype>
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15
</hype>
--- End Message ---
--- Begin Message ---
At 10:00 PM -0500 11/8/10, David McGlone wrote:
On Mon, 2010-11-08 at 23:36 +0100, [email protected] wrote:
> IMHO - If you have to jump in and out of HTML and template syntax you
might as well jump in and out of HTML and PHP.
There is truth to this, but for me, its helping me learn in a much
clearer way. I can't explain how or why, but it make me feel like
everything is neat and tidy and where it should be. Where PHP and HTML
mixed and mingled gives me the feeling that everything is a disaster.
--
Blessings,
David M.
It can be a disaster, but that's your choice -- and that's the point.
You can dig as deep a hole as you like, or make it simple for
yourself.
I don't use template engines. I simply place php echo()s where I need
them while maintaining a strict division between content and
presentation using "best practices" between html and css.
Additionally, I believe that one also has to consider how JavaScript
fits into the needs of the application and thus adherence to
progressive enhancement is also a must. Templates and DOM operations
can become very involved and problematic.
In all, you must consider content, presentation, function, and data.
Granted those boundaries become blurred when viewing both client and
server side operations, but I don't find any template engines that
make it any easier in design and implementation.
While a cursory review of smarty (et al) may appear to solve minor
problems, the more involved an application becomes, the more I find
templates don't fit and are often more trouble than they are worth.
YMMV.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
The parse worked great, got all the information I needed. Being so new to php,
I am not sure how to get this information to display in an html table so that
I can style it...any suggestions would be greatly appreciated. It displays in
my browser but I have not been able to figure out how to get it into a table on
a page. (This is not the whole script, just wanted to show the portion to try
to give a picture...of what I was working with... SimpleXMLElement.)
foreach ($guildxml->guildInfo->guild->members->children() as $char) {
if ( $char['level'] < 20 ) continue;
$toonrace = return_race($char['raceId'], $char['genderId']); //
Maps Race and Sex
$toonclass = return_class($char['classId']); // Maps class
name
$toonrank = return_rank($char['rank']); // Maps guild rank name
$cch = curl_init();
curl_setopt ($cch, CURLOPT_URL, $charurl . $char['url']);
curl_setopt ($cch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($cch, CURLOPT_USERAGENT, $browser_user_agent);
$charxml = curl_exec($cch);
$detailxml = new SimpleXMLElement($charxml);
echo '<b>Name:</b> <a href="' .$charurl . $char['url'] .'"
target="_blank">' . $char['name'] . '</a> '; //Includes an armory external
link
echo '<b>Class:</b> ' . $toonclass . ' ';
echo '<b>Race:</b>' . $toonrace . ' ';
echo '<b>Rank:</b> ' . $toonrank .' ';
echo '<b>Level:</b> ' . $char['level'] . ' '; // Displays char
level
echo '<b>Professions: </b> ';
foreach ($detailxml->characterInfo->characterTab->professions->children()
as $profession) {
if ($profession['name']=NULL) continue;
// Displays all of the professions and skill levels and maximums
echo $profession['name'] . ' (' . $profession['value'] . '/' .
$profession['max'] .') ';
}
echo '<b>Specs: </b> ';
foreach ($detailxml->characterInfo->characterTab->talentSpecs->children()
as $spec) {
// Displays all of the specs in use and their builds and names. It
is easily possible to show which one is active as well.
echo $spec['prim'] . '(' . $spec['treeOne'] . '/' .
$spec['treeTwo'] . '/' . $spec['treeThree'] . ') ';
}
echo '<br>';
} ggestions? The manual is a bit overwhelming, and I have searched for a
solution, am really lost.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Monday, November 08, 2010 7:41 PM
> To: [email protected]
> Subject: [PHP] After parsing
>
> The parse worked great, got all the information I needed. Being so new to
> php, I am not sure how to get this information to display in an html table so
> that I can style it...any suggestions would be greatly appreciated. It
> displays
> in my browser but I have not been able to figure out how to get it into a
> table on a page. (This is not the whole script, just wanted to show the
> portion to try to give a picture...of what I was working with...
> SimpleXMLElement.)
>
>
>
> foreach ($guildxml->guildInfo->guild->members->children() as $char) {
> if ( $char['level'] < 20 ) continue;
> $toonrace = return_race($char['raceId'], $char['genderId']); //
> Maps
> Race and Sex
> $toonclass = return_class($char['classId']); // Maps class
> name
> $toonrank = return_rank($char['rank']); // Maps guild rank name
>
> $cch = curl_init();
> curl_setopt ($cch, CURLOPT_URL, $charurl . $char['url']);
> curl_setopt ($cch, CURLOPT_RETURNTRANSFER, true);
> curl_setopt ($cch, CURLOPT_USERAGENT, $browser_user_agent);
> $charxml = curl_exec($cch);
> $detailxml = new SimpleXMLElement($charxml);
>
>
> echo '<b>Name:</b> <a href="' .$charurl . $char['url'] .'"
> target="_blank">' .
> $char['name'] . '</a> '; //Includes an armory external link
> echo '<b>Class:</b> ' . $toonclass . ' ';
> echo '<b>Race:</b>' . $toonrace . ' ';
> echo '<b>Rank:</b> ' . $toonrank .' ';
> echo '<b>Level:</b> ' . $char['level'] . ' '; // Displays char
> level
> echo '<b>Professions: </b> ';
>
> foreach ($detailxml->characterInfo->characterTab->professions-
> >children() as $profession) {
> if ($profession['name']=NULL) continue;
> // Displays all of the professions and skill levels and maximums
> echo $profession['name'] . ' (' . $profession['value'] . '/' .
> $profession['max'] .') ';
> }
> echo '<b>Specs: </b> ';
> foreach ($detailxml->characterInfo->characterTab->talentSpecs-
> >children() as $spec) {
> // Displays all of the specs in use and their builds and names. It
> is
> easily possible to show which one is active as well.
> echo $spec['prim'] . '(' . $spec['treeOne'] . '/' .
> $spec['treeTwo'] . '/'
> . $spec['treeThree'] . ') ';
> }
> echo '<br>';
> } ggestions? The manual is a bit overwhelming, and I have searched for a
> solution, am really lost.
Create a table with a header. In the header, put 'Name', 'Class', 'Race',
'Rank', 'Level', 'Professions' in each column. Then just loop through your
data for each table row and put the data into the proper column accordingly.
After the loop for the data, just close the table.
echo
'<table><tr><th>Name</th><th>Class</th><th>Race</th><th>Rank</th><th>Level</th><th>Professions</th></tr>';
foreach () {
// data init
echo '<tr>';
echo '<td>'.$char['name'].'</td>';
echo '<td>'.$toonclass.'</td>';
// etc...
echo '</tr>';
}
echo '</table>';
Regards,
Tommy
--- End Message ---
--- Begin Message ---
Hello,
I would like to know what is the difference between follows.
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46)
and
PHP 5.1.6-pl6-gentoo (cgi-cgi)
One is "cli" another is "cgi-cgi" .
Sincerely,
Tseveen.
--- End Message ---
--- Begin Message ---
why not search them with keywords "cli cgi diff"?
they are all the Interface to PHP interpretor. one is Command Line
I,another is Common Gateway I.
Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)
2010/11/9 Tseveendorj Ochirlantuu <[email protected]>:
> Hello,
>
> I would like to know what is the difference between follows.
>
> PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46)
>
>
> and
>
> PHP 5.1.6-pl6-gentoo (cgi-cgi)
>
>
>
> One is "cli" another is "cgi-cgi" .
>
> Sincerely,
>
> Tseveen.
>
--- End Message ---
--- Begin Message ---
Looks great.
Thanks.
***?imdi her yerde ?ubemiz var:
http://www.anadolusigortaonline.com.tr a??ld?.-----Original Message-----
From: Lukasz Cepowski [mailto:[email protected]]
Sent: Tuesday, November 09, 2010 12:34 AM
To: [email protected]
Subject: [PHP] Vermis The Issue Tracking System
Hello,
some time have past since the last release and some changes have been made.
Vermis, the new open source issue tracker written in PHP,
based on Zend Framework and Doctrine ORM is heading towards stable
version 1.0.
Today I would like to introduce the latest development version
(r63-20101108) containing many bug fixes and some new features.
What is new in the project:
- Improved issues navigator, allows you to browse your issues in an
easier way by breaking them by component, milestone, type, status and
priority.
- SMTP integration, you don't need to setup a mail service on your
machine, use any mail account and send notification emails via SMTP.
- IIS Support, even if you can't install Apache you can still enjoy
using Vermis on your Windows box, finally Vermis is working under
Microsoft IIS Web Server.
- Lightbox, show your image attachments in a popup box.
- Migration guard, you can safely upgrade Vermis to the latest version.
You can try out the online demo at http://vermis.diabloware.com
Feel free to test, download and use Vermis.
Please let me know if everything is working as it should, any kind of
feedback is much appreciated :)
Home page: http://vermis.diabloware.com
Forum: http://forum.diabloware.com
Bugs: http://bugs.diabloware.com
Thanks, Lukasz (cepa) Cepowski
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan,
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.
This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message in error,
please immediately notify the sender and delete it from your system. Our
company has no legal responsibility for the contents of the message and its
attachments. Our company shall have no liability for any changes or late
receiving, loss of integrity and confidentiality, viruses and any damages
caused in anyway to your computer system.
--- End Message ---