Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Tutorials > Tutorials & Articles

Tutorials & Articles The place to comment on the PHP-Editors published tutorials & articles.

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 2004-08-09, 12:38 AM
David Cochrane
Guest
 
Posts: n/a
Default

Hope you have resolved your server problem.

Agree with all the comments prevously posted. You kept it simple enough for just about anybody to understand and used a good example.

You are talking of doing an advanced classes next. How about an intermediary classes one next, with a few more excellent examples, possibly with using more than one class or even using a class within a class.

Many thanks for this article

David Cochrane
Reply With Quote
  #12 (permalink)  
Old 2004-08-21, 11:25 PM
shev
Guest
 
Posts: n/a
Default

hehe yeah
i also finally got it

my main problem was with two things

first that class defines a data structure which can be used
multiple types

second the way how $this is handled

i used php 5 and XML subsets
which used a lot of -> as well, and i felt familiar with that

the example you provided now was EXACTLY what i needed to understand it - now i can once again try to tackle the big
c++ code of some of my favorite programs which i need to tweak to make em optimal

well, after all, programming includes repetitive things, so, if you understood something once, you have REALLY learned sth

so
thanks a lot for this

PS: maybe one day you are going into a more complex example using struct and classes for php
to do sth nifty
Reply With Quote
  #13 (permalink)  
Old 2004-09-29, 02:48 PM
Junior Member
 
Join Date: Sep 2004
Posts: 1
plbt5
Default

Indeed a clear example.
But...

What is not clear to me is why you handle the $Content variable different than the other two variables ($Title, $Keywords). The latter ones just get their data by an explicit assignment, whilst for the $content variable the method setContent($Data) is used to pass the data to it.
In other words, in stead of applying:
$Sample->SetContent( $Content );
why don't you use:
$Sample->Content = $Content;
Reply With Quote
  #14 (permalink)  
Old 2004-09-29, 07:02 PM
Member
 
Join Date: Apr 2004
Location: Gresham, Oregon. United States
Posts: 46
CYBER_Aeon
Default

To be honest, there is no reason you can't do that. In fact, that is what I normally do anyway, its quicker. However, I used the functions to demonstrate how to implement functions in classes that required you to pass variables. Most people wouldn't have used a function just for that, you would generally use it for something more complex. I just needed an excuse to demonstrate a function.

Good catch though.
Reply With Quote
  #15 (permalink)  
Old 2004-10-08, 02:20 AM
Junior Member
 
Join Date: Oct 2004
Posts: 1
dbratton
Default

Any help would be appreciated. The if statement is actually below the $NoResultsCode variable, but thought it might be better to show what I am trying to do.

I want to include another php file and place in a variable, say $ShowCalendar. If the if statement is true it does an echo of the "NoResultCode in which I want the variable I have the include stored in. Can this be done?

Thanks

include ("calendar.php");

if ($numberall==0) {
// Here we are saying, if no records found display message and a link to go back to the main index page
echo "$NoResultsCode";

$NoResultsCode = "<a name=\"top\"></a><table border=\"2\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">";
$NoResultsCode .= "<tr><td><table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">";
$NoResultsCode .= "<tr><td width=\"210\" valign=\"top\" bgcolor=\"#000000\"><p align=\"center\"><img src=\"images/prflogo2.jpg\" width=\"210\" height=\"130\"></p>";
$NoResultsCode .= "<p align=\"center\"></p><p align=\"center\">
</p></td><td width=\"500\" valign=\"top\" bgcolor=\"#FFFFFF\"><div align=\"center\">";
$NoResultsCode .= "


<img src=\"images/admin_deleted_req_title.jpg\">

<span class=\"style1\">Sorry Kevin, no estimate requests
have been marked deleted! </span></p></div></td>";
$NoResultsCode .= "<td width=\"210\" valign=\"top\" bgcolor=\"#000000\"><div align=\"center\"><p align=\"center\"><img src=\"images/construction.gif\" width=\"210\" height=\"130\"></p>";
$NoResultsCode .= "<div align=\"center\">


<img src=\"images/bar.jpg\" width=\"171\" height=\"7\"></p></div>";
$NoResultsCode .= "<p align=\"center\"><span class=\"style8\">Call for a</span> <span class=\"style3\">FREE</span> <span class=\"style8\">Estimate
";
$NoResultsCode .= "515.202.1475
515.288.1161</span></p><p align=\"center\"><img src=\"images/bar.jpg\" width=\"171\" height=\"7\"></p>";
$NoResultsCode .= "<p align=\"center\"><span class=\"style8\">Copyright &copy; 2004 ConcretePRF.
All rights reserved.</span>
";
$NoResultsCode .= "
<a href=\"mailto:webmaster@concreteprf.com\" class=\"style2\">ConcretePRF Webmaster</a></span></p>";
$NoResultsCode .= "<p align=\"center\"><img src=\"images/bar.jpg\" width=\"171\" height=\"7\"></p><span class=\"style2\">$ShowCalendar</span>";
$NoResultsCode .= "<p align=\"center\"><img src=\"images/bar.jpg\" width=\"171\" height=\"7\"></p><span class=\"style3\">Current Estimate Schedule:</span></div>";
$NoResultsCode .= "

<div align=\"left\"></p></div>";
$NoResultsCode .= "</td></tr></table></td></tr></table></body></html>";
Reply With Quote
  #16 (permalink)  
Old 2004-10-17, 06:57 PM
van
Guest
 
Posts: n/a
Default

very helpful tutorial! i was having trouble grasping using classes and this explains every element of it.

thanks
Reply With Quote
  #17 (permalink)  
Old 2005-03-02, 05:51 AM
Junior Member
 
Join Date: Mar 2005
Posts: 1
frendelp
Default

Well you did a good job.... The tutorial is really easy to understand and I considered it as a missing link in learning the basic concept of Classes in PHP hehe.... Well that's all folks -Frendel Thanks a lot
Reply With Quote
  #18 (permalink)  
Old 2005-08-30, 11:47 AM
Junior Member
 
Join Date: Aug 2005
Posts: 1
bhutz
Default

Would just like to say thanks for a really easy to understand tutorial on classes...been lookin through a few all day and would say this has helped my understanding the most.

Thanks again
__________________
Carlton Dickson
Reply With Quote
  #19 (permalink)  
Old 2006-03-17, 01:54 PM
Junior Member
 
Join Date: Mar 2006
Posts: 1
viking777
Default

Very, very good SIMPLE example of what classes actually are. Most of the other tutorials on classes I've tried to read have chosen such a complex subject to begin with, that the concept of 'class' is totally lost in an unpenetrable fog of complexity. So thank you very much to the author of this tutorial.

Now I understand.

Regards,

viking777

"There's no such things as stupid Questions - only Stupid Answers."
Reply With Quote
  #20 (permalink)  
Old 2006-04-06, 02:49 PM
Junior Member
 
Join Date: Apr 2006
Posts: 1
megaman is on a distinguished road
Default

I'm just a beginner. Reading through it, I am finally starting to grasp what classes and objects are.

But I was wondering what the output is supposed to look like? I'm not sure if I'm doing it right.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:43 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.