Re: [PHP] OOP slow -- am I an idiot?

2006-10-11 Thread Stut
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: Richard Lynch wrote: On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: I want to create a customer class which fetches its attributes from a MySQL database. No, you don't. :-) This is a classic example of the

[PHP] OOP slow -- am I an idiot?

2006-10-10 Thread Chris de Vidal
I think perhaps I'm using classes and OOP incorrectly. The last time I used them, they were slow. I want to create a customer class which fetches its attributes from a MySQL database. Something like this pseudocode: class customer { ... getName ($id) { $result =

Re: [PHP] OOP slow -- am I an idiot?

2006-10-10 Thread Chris
Chris de Vidal wrote: I think perhaps I'm using classes and OOP incorrectly. The last time I used them, they were slow. The examples you provided shows that it's not OOP that's the problem, it's how your getting the data as you suspected. Doing tons of queries is going to be slow whether

Re: [PHP] OOP slow -- am I an idiot?

2006-10-10 Thread Larry Garfield
For your rudimentary example of object-relational mapping below, yes, performance is going to be atrocious. That's because you're not taking any advantage of the features that using OOP gives you. One could write a dissertation on this problem, but I will just give you some general

Re: [PHP] OOP slow -- am I an idiot?

2006-10-10 Thread Johan Martin
On 10 Oct 2006, at 4:14 PM, Chris de Vidal wrote: I think perhaps I'm using classes and OOP incorrectly. The last time I used them, they were slow. I want to create a customer class which fetches its attributes from a MySQL database. Something like this pseudocode: class customer

[PHP] OOP Hello World

2006-09-28 Thread Martin Alterisio
What's up folks? I just wanted to tell you about a thread that's going on in the spanish php mailing list. A fellow software developer which had just started with OOP was asking for Hello World examples using OOP. The examples of code he had been doing was not that different from the usual Hello

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent constructors. Well there's a

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread chris smith
On 5/1/06, Edward Vermillion [EMAIL PROTECTED] wrote: On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
Thanks guys! I guess it comes down to Don't do anything stupid and you should be fine :D I'm just still in the design stage, and since my past practice was write/figure out what you did wrong why it doesn't work like it should/rewrite, I'm trying to cover as many bases as I can from the

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Richard Lynch
On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the constructor? Is it doubling the memory consumption, or more,

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Jochem Maas
Richard Lynch wrote: On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the constructor? Is it doubling the memory

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On May 1, 2006, at 3:53 PM, Richard Lynch wrote: On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread chris smith
On 5/2/06, Edward Vermillion [EMAIL PROTECTED] wrote: On May 1, 2006, at 3:53 PM, Richard Lynch wrote: On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory,

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On May 1, 2006, at 8:56 PM, chris smith wrote: Depending on your content you could cache some of it to static files.. http://pear.php.net/packages.php?catpid=3catname=Caching (I'm sure there are tons more packages to do this as well).. Yeah, that's what I'm looking at right now, although

[PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Edward Vermillion
I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situations where both methods will do the same thing for you. Is there any overhead to creating an object from

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situations where both methods will do the same thing for you. Is there any overhead to

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Edward Vermillion
On Apr 30, 2006, at 10:10 AM, Jochem Maas wrote: Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situations where both methods

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 10:10 AM, Jochem Maas wrote: Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Edward Vermillion
On Apr 30, 2006, at 10:45 AM, Jochem Maas wrote: CVS or subversion (and 3 weeks intensive study of what branches are) might be of help to you - not for the faint-hearted though! Been reading the subversion manual for the past three days... ;) (I'm a slow reader) Ed -- PHP General

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 10:45 AM, Jochem Maas wrote: CVS or subversion (and 3 weeks intensive study of what branches are) might be of help to you - not for the faint-hearted though! Been reading the subversion manual for the past three days... ;) (I'm a slow

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Stut
Jochem Maas wrote: me I'm just slow - I still on 'how the f*** do I use branches in CVS' after using it for 18 months+; and I haven't even begun to look at subversion yet :-P I strongly suggest you skip branches in CVS and go straight to subversion. I've been using CVS for years and have

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Richard Lynch
Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent constructors. I can't speak to differences in PHP4/PHP5 in this specific regard, but

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jesper Gran
On 2005-10-21 06:17, Stephen Leaf wrote: most likely var is depreciated in php5. (can someone confirm this?) Well, if I try to use Var in a class i get this message: Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in C:\code\test\var.php on line 3*

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jochem Maas
Bob, 'wrapping' you class definition within HTML like you have done is not only weird but down right ugly. I recommend sticking each class you write in a seperate file and using include_once() or require_once() before you output anything to the browser. basically try to seperate you code into

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Stephen Leaf
would have to be. http://smileaf.org/bob.php as you can see it's working great. did make few more changes: class Test { public $saying = ; function __construct() {

[PHP] OOP Newbie - why does this not work?

2005-10-20 Thread Bob Hartung
Hi all, I'm trying to get started in OOP with PHP. I have the following short code snipped. I'f I comment out the 'class Test' definition and the following references to it, it prints This is outside the php code block and Start defining the class here: If I do not comment

Re: [PHP] OOP Newbie - why does this not work?

2005-10-20 Thread Stephen Leaf
Try removing the /* and */ Other than that, check your brackets. you never closed the get() function's On Thursday 20 October 2005 09:35 pm, Bob Hartung wrote: Hi all, I'm trying to get started in OOP with PHP. I have the following short code snipped. I'f I comment out the 'class Test'

Re: [PHP] OOP Newbie - why does this not work?

2005-10-20 Thread Stephen Leaf
Sorry.. 1 more thing. php5 does not use var. use public $variable=value; instead. public is only within a class however. you cannot use it outside. On Thursday 20 October 2005 09:35 pm, Bob Hartung wrote: Hi all, I'm trying to get started in OOP with PHP. I have the following short code

Re: [PHP] OOP Newbie - why does this not work?

2005-10-20 Thread Stephen Leaf
Here is the working code You had __constructor() it's __construct() notice I also moved your saying declaration outside of the constructor. this is to make it a class level variable. the way that you had it set it was only in scope until you finished the construct code. I guess I was wrong

[PHP] php OOP book ¿...?

2005-07-01 Thread enriquebris
I´m looking for a book dedicated to OOP in PHP ... Now I´m reading ¨Core PHP Programming (Third Edition) (2003)¨ but it has just a few information about OOP. Do you know another book? ¿Do you have it? If anyone wants this book (Core PHP Programming (Third Edition) (2003)) just email me

[PHP] [OOP] Class to handle PEAR::DB

2004-11-18 Thread valerie17
I'm making a counter using DB, 1 ?php 2 require_once 'DB.php'; 3 4 $sql_type = 'mysql'; 5 $sql_user = 'root'; 6 $sql_pass = ''; 7 $sql_host = 'localhost'; 8 $sql_db = 'valerie'; 9 10 $dsn= $sql_type://$sql_user:[EMAIL

Re: [PHP] [OOP] Class to handle PEAR::DB

2004-11-18 Thread Jason Wong
On Thursday 18 November 2004 17:05, [EMAIL PROTECTED] wrote: my problem is : everytime I execute this file in CLI mode I always got this [...] Standard Message: DB Error: no database selected Standard Code: -14 DBMS/User Message: SELECT * FROM country [nativecode=1046 ** No Database

Re: [PHP] [OOP] Class to handle PEAR::DB

2004-11-18 Thread valerie17
just the logic of my OOP code go wrong ? Valérie Delon étudiante -- On a besoin d'apprendre beacoup plus Quelqu'un croit c'est trop Mais j'crois que ce n'est pas assez From: Jason Wong [EMAIL PROTECTED] Date: Thu, 18 Nov 2004 19:06:56 +0800 Subject: Re: [PHP] [OOP] Class to handle PEAR::DB

[PHP] OOP, Out of Scope Issue

2004-11-07 Thread Jonathan Chum
I have a class called FrontEnd which extends a TemplateManager class. The purpose of the TemplateManager class is to initate Smarty. So my FrontEnd constructor looks like this: function FrontEnd() { $db = new DatabaseConnection(); $this-db = $db-initDatabase(); $this-sm =

RE: [PHP] OOP, Out of Scope Issue

2004-11-07 Thread Zareef Ahmed
PROTECTED] Subject: [PHP] OOP, Out of Scope Issue I have a class called FrontEnd which extends a TemplateManager class. The purpose of the TemplateManager class is to initate Smarty. So my FrontEnd constructor looks like this: function FrontEnd() { $db = new DatabaseConnection(); $this-db

Re: [PHP] OOP, Out of Scope Issue

2004-11-07 Thread Jonathan Chum
Ahmed -Original Message- From: Jonathan Chum [mailto:[EMAIL PROTECTED] Sent: Monday, November 08, 2004 9:52 AM To: [EMAIL PROTECTED] Subject: [PHP] OOP, Out of Scope Issue I have a class called FrontEnd which extends a TemplateManager class. The purpose of the TemplateManager class

[PHP] OOP -- passing messages between objects

2004-10-11 Thread Sandy Keathley
Can someone tell me the proper syntax for accessing a method in one class from another class? I used this, where $obj and $page are instantiated objects: (From the $page class) obj::getData($id); It worked in an application on one server, failed in another application on another server.

[PHP] PHP OOP Question

2004-09-08 Thread Paul Waring
Is it bad practice for a class to have a variable and method of the same name? Well, it's a matter of opinion what is and isn't bad practice, but personally I would never give a variable and a function the same name - if only to avoid confusion (PHP shouldn't mind if you do so though). Paul --

[PHP] PHP OOP Question

2004-09-07 Thread ed . lazor
Is it bad practice for a class to have a variable and method of the same name? For example: class product { var $Name; function Name() { return stripslashes($this-Name); } } Thanks, -Ed This message was

[PHP] OOP in PHP 5 won't work under IIS 5.1

2004-09-05 Thread Felix Ang
I installed PHP 5 and tried phpinfo(). It worked. But then I tried OOP sample from www.php.net http://www.php.net/ , like: ?php class MyClass { private $Hello = Hello, World!\n; protected $Bar = Hello, Foo!\n; protected $Foo = Hello, Bar!\n; function printHello() {

[PHP] oop too slow

2004-08-19 Thread Krzysztof Gorzelak
Hi I'm trying my new php5 script, but it takes about 1.2s to generate my page. That is, how my oop model looks like : [category] ||| [photo] [desc] [products] [products] | [product] ||| [photo] [desc] [keys] [keys] | [key] | [values] |

[PHP] oop too slow

2004-08-19 Thread Krzysztof Gorzelak
Hi I'm trying my new php5 script, but it takes about 1.2s to generate my page. That is, how my oop model looks like : [category] ||| [photo] [desc] [products] [products] | [product] || | [photo] [desc] [keys] [keys] | [key] |

Re: [PHP] oop too slow

2004-08-19 Thread Marcus Bointon
on 19/8/04 9:49, Krzysztof Gorzelak at [EMAIL PROTECTED] wrote: Hi I'm trying my new php5 script, but it takes about 1.2s to generate my page. That is, how my oop model looks like : [category] ||| [photo] [desc] [products] [products] | [product] |

Re: [PHP] oop too slow

2004-08-19 Thread Jason Davidson
When i have many many objects of the same type to build, i do something like this... function getEvents($sql = '') { $events = $this-dbh-query( SELECT cols, cols, FROM table,table WHERE blah blah balh ($sql ? AND $sql : ''),'rows_array');

Re: [PHP] oop too slow

2004-08-19 Thread Krzysztof Gorzelak
U¿ytkownik Jason Davidson [EMAIL PROTECTED] napisa³ w wiadomo¶ci news:[EMAIL PROTECTED] When i have many many objects of the same type to build, i do something like this... function getEvents($sql = '') { $events = $this-dbh-query( SELECT cols, cols, FROM table,table WHERE blah blah balh

Re: [PHP] OOP, Classes, Sharing Code

2004-06-29 Thread Gabriel Birke
Hello! Another option would be to have a generic List class that displays items in a list. Both your Album and Photo class should implement a method like getNextItem or the PHP5-native iterator methods so the List class can iterate over a class assigned to it without knowing what it is. If

Re: [PHP] OOP, Classes, Sharing Code

2004-06-29 Thread rush
Joel Kitching [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What generic class name would be appropriate in this case? I just can't see how I would link the two together. Also, they would have to use fairly generic variables names if I were to do this. Like using the variable

[PHP] OOP, Classes, Sharing Code

2004-06-28 Thread Joel Kitching
I'm kind of new to OOP, so bear with me here... I have a portfolio which contains albums. These albums contain photos. So it would be natural to declare the classes: Portfolio Album Photo It seems to me that none of these classes have the is a relationship, and therefore can not be extended

RE: [PHP] OOP, Classes, Sharing Code

2004-06-28 Thread Jay Blanchard
[snip] So my question is, should I just duplicate the code in each class (Portfolio and Album), or is there a better way of organizing all of this? [/snip] If you are going to duplicate code why not just create a generic class with the code that would be duplicated and then extend the class as

Re: [PHP] OOP, Classes, Sharing Code

2004-06-28 Thread Joel Kitching
On Mon, 28 Jun 2004 13:41:19 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: If you are going to duplicate code why not just create a generic class with the code that would be duplicated and then extend the class as required? What generic class name would be appropriate in this case? I just

Re: [PHP] OOP, Classes, Sharing Code

2004-06-28 Thread Torsten Roehr
Joel Kitching [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 28 Jun 2004 13:41:19 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: If you are going to duplicate code why not just create a generic class with the code that would be duplicated and then extend the class as

Re: [PHP] OOP, Classes, Sharing Code

2004-06-28 Thread Red Wingate
Look correct from my point of view... class Portfolio { var $portfolioID ; var $albums = array () ; function Portfolio ( $newID ) { $this-portfolioID = $newID ; } function addAlbum ( $album ) { $this-albums[] = $album ; } function getAlbum () { return current

[PHP] OOP variables

2004-04-15 Thread Jarratt Ingram
Hello, I was wondering if somebody would mind explaining this to me, is there a big difference or requirement to pre defining variables your going to use in a class eg: class name { $var1 = ''; $var2 = ''; function blah(){ $var2 }

Re: [PHP] OOP variables

2004-04-15 Thread Richard Harb
http://www.php.net/manual/en/language.oop.php states: [quote] In PHP 4, only constant initializers for var variables are allowed. To initialize variables with non-constant values, you need an initialization function which is called automatically when an object is being constructed from the class.

Re: [PHP] OOP variables

2004-04-15 Thread Chris Boget
[quote] In PHP 4, only constant initializers for var variables are allowed. To initialize variables with non-constant values, you need an initialization function which is called automatically when an object is being constructed from the class. Such a function is called a constructor (see

[PHP] OOP Question

2004-04-07 Thread Richard Lewis
What do members think that this code should do: class A { var $a, $b; function A($a) { $this-$a = $a; } function prnt() { echo bra= . $this-$a; } } class B extends A { function B($a, $b) { parent::A($a); $this-$b = $b; } function prnt() {

Re: [PHP] OOP Question

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 17:07, Richard Lewis wrote: What do members think that this code should do: class A { var $a, $b; function A($a) { $this-$a = $a; } function prnt() { echo bra= . $this-$a; } } class B extends A { function B($a, $b) {

[PHP] OOP Class Interaction

2004-03-31 Thread Jonathan Pitcher
I have been writing OOP programs for the past couple years. Over these years I have run into the same problem, I have solved the problem in many different ways. I was wondering if there is a recommended way to solve the problem I have listed below. To keep it simple, lets say I have 3

Re: [PHP] OOP Class Interaction

2004-03-31 Thread Robert Cummings
On Wed, 2004-03-31 at 12:55, Jonathan Pitcher wrote: I have been writing OOP programs for the past couple years. Over these years I have run into the same problem, I have solved the problem in many different ways. I was wondering if there is a recommended way to solve the problem I have

[PHP] OOP Get Parent data

2004-03-11 Thread Rolf van de Krol
Hi everybody, In the code below are three x-char in the function parent_test of the class browser. What do I have to type there when I want to get the var $test from the session-object. class session { var $test=TEST; var $browser; function init() { $this-browser = new browser; } } class

Re: [PHP] OOP Get Parent data

2004-03-11 Thread Stuart
Rolf van de Krol wrote: class session { var $test=TEST; var $browser; function init() { $this-browser = new browser; } } class browser { function parent_test() { return xxx; } } I tried $this-parent-test but it doesn't work. Can anybody help me? There is no implicit reference created in

[PHP] OOP methodology

2004-01-30 Thread Chris Neale
This is a long one - I'm trying to get to grips with my understanding of OOP. I'm not sure that I understand object oriented programming as well as I could to benefit from using it in PHP. Although I've used it to produce working applications, of the few objects I've produced nearly all have

Re: [PHP] OOP methodology

2004-01-30 Thread Raditha Dissanayake
Hi Chris, Sounds to me like you are pretty much on the right track bearing in mind that PHP is not the bes language to learn OOP. Even your taskmanager sounds good, i wouldn't bother with reading up on design patterns just yet. They are indeed very important and you should definitely study

RE: [PHP] OOP methodology

2004-01-30 Thread electroteque
To: [EMAIL PROTECTED] Subject: [PHP] OOP methodology This is a long one - I'm trying to get to grips with my understanding of OOP. I'm not sure that I understand object oriented programming as well as I could to benefit from using it in PHP. Although I've used it to produce working applications

RE: [PHP] OOP methodology

2004-01-30 Thread electroteque
good to add it in, does it work in php4 ? -Original Message- From: Raditha Dissanayake [mailto:[EMAIL PROTECTED] Sent: Friday, January 30, 2004 9:19 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] OOP methodology Hi Chris, Sounds to me like you are pretty much on the right

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Jay Blanchard
[snip] Yes i think java would be the best to learn proper OO, i've nevr done it, but coming the other way knowing php OO, java became more familiar to me, i'm gonna do it this year. [/snip] Why not start with the king of OOP, C++? Currently C++ is the most robust implementor of OOP design issues.

Re: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Justin Patrin
Jay Blanchard wrote: [snip] Yes i think java would be the best to learn proper OO, i've nevr done it, but coming the other way knowing php OO, java became more familiar to me, i'm gonna do it this year. [/snip] Why not start with the king of OOP, C++? Currently C++ is the most robust implementor

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Jay Blanchard
[snip] Hehe, and here is where we start a holy war. [/snip] Bring it. [snip] I would have to disagree. While it may be possible to implement good OOP in C++, it does not nearly implement OOP as well as many other languages. It also has many other design problems that hinder the learning of OOP.

Re: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Chris Boget
Which of the many other languages implement OOP better? Smalltalk, for one. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Kelly Hallman
On Fri, 30 Jan 2004, Jay Blanchard wrote: I would have to disagree. While it may be possible to implement good OOP in C++, it does not nearly implement OOP as well as many other languages. It also has many other design problems that hinder the learning of OOP. I respect your opinion and

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Ajai Khattri
On Fri, 30 Jan 2004, Kelly Hallman wrote: Other languages dispense with a lot of the formalities found in C++ (a good or bad thing, depending on your perspective). I found Python to be a great language to learn OOP, since it forces good habits on you. C++ is a very large unwieldly language -

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Jay Blanchard
[snip] Experience has chown that smaller simpler languages are easier to learn and apply than larger ones. [/snip] Obviously. :) I'd be curious as to how many cam to PHP from a programming background? Likewise, how many start with PHP and go on to other languages? And what those languages are

Re: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Chris Garaffa
On Jan 30, 2004, at 2:19 PM, Jay Blanchard wrote: I'd be curious as to how many cam to PHP from a programming background? Likewise, how many start with PHP and go on to other languages? And what those languages are either direction? Probably a strange mix, but... I came to PHP from an

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Kelly Hallman
On Fri, 30 Jan 2004, Jay Blanchard wrote: I'd be curious as to how many cam to PHP from a programming background? Likewise, how many start with PHP and go on to other languages? And what those languages are either direction? I started serious coding in perl. When I found PHP, I realized I was

Re: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Justin Patrin
Jay Blanchard wrote: [snip] Experience has chown that smaller simpler languages are easier to learn and apply than larger ones. [/snip] Obviously. :) I'd be curious as to how many cam to PHP from a programming background? Likewise, how many start with PHP and go on to other languages? And what

Re: [PHP] OOP methodology

2004-01-30 Thread Adam Bregenzer
On Fri, 2004-01-30 at 04:41, Chris Neale wrote: The main application would then do this: $q = new dbObj; $x = new iterator; $y = new HTMLGenerator($q, $x) while ($x-next()) { $y-MakeHTML(); $y-outputToFile(); } Anyone got any thoughts about whether this is a good way to

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread electroteque
Ok sorry, c++ then, yes thats another kettle of fish, i'm going to be doing some c++ to learn how to make vst plugins :D -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, January 30, 2004 10:51 PM To: electroteque; [EMAIL PROTECTED] Subject: RE: [PHP] OOP

[PHP] OOP design question

2004-01-05 Thread Mike Smith
I am starting to get a handle (I think) on OOP. I was wondering if anyone would care to comment on what I think I understand: For simplicity's sake class.php contains AddItem() and DisplayItems(). Since submitting form data ?php include('class.php'); If(!$_POST['submit']){ //Do I need to

[PHP] free PHP OOP book - Web applications desgin

2003-11-21 Thread Nagib Abi Fadel
Hi, can anyone suggest a free PHP Object Oriented Programming book ... Or an Object Oriented Book for web applications. Plus i want to design customizable web pages: - I can change the hole layout by changing one file - If i change a database table i don't have to change alot in the code ... Is

[PHP] Re: free PHP OOP book - Web applications desgin

2003-11-21 Thread Lucian Cozma
If you want customizable layout without changing the logic, try the MVC approach (model-view-control). The best way to do it is to create the data from php in a XML (generate the logic), then create the layout with XSL. Thus, if you want to change the layout, all you have to do is to

Re: [PHP] free PHP OOP book - Web applications desgin

2003-11-21 Thread Burhan Khalid
Nagib Abi Fadel wrote: Hi, can anyone suggest a free PHP Object Oriented Programming book ... I don't know of a free one. But http://www.php.net/manual/en/ref.classobj.php is good starting point. Also try http://www.zend.com/zend/tut/ Or an Object Oriented Book for web applications. Plus i

[PHP] OOP clarification: Messages between objects

2003-11-12 Thread Robert Ian Smit
I am trying to implement a generic form handler that is capable of printing the form and checking the user input. I want this application to be useful in the end, but I also use it to explore OOP in PHP. The working code at the moment is able to add HTML input elements to the page. These fields

Re: [PHP] OOP clarification: Messages between objects

2003-11-12 Thread Robert Cummings
On Wed, 2003-11-12 at 04:31, Robert Ian Smit wrote: I am trying to implement a generic form handler that is capable of printing the form and checking the user input. I want this application to be useful in the end, but I also use it to explore OOP in PHP. The working code at the moment is

Re: [PHP] OOP clarification: Messages between objects

2003-11-12 Thread Boyan Nedkov
Robert Ian Smit wrote: I am trying to implement a generic form handler that is capable of printing the form and checking the user input. I want this application to be useful in the end, but I also use it to explore OOP in PHP. .. I'd like the zipcode object to ask a question to

[PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
I want to be able to set a base class in a settings file, and then have other classes extend the base class, but PHP won't let me do what I have tried. I get the following error: Fatal error: Class cepweb: Cannot inherit from undefined class my_base_class in /home/me/my_child_class.php on line

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jough Jeaux
Shouldn't this line: class my_child_class extends MY_BASE_CLASSFILE { Read like this: class my_child_class extends MY_BASE_CLASS { After all base_class.php isn't the name of your class, base_class is. Jackson Miller [EMAIL PROTECTED] wrote: I want to be able to set a base class in a settings

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
php is not c, you can't use constants this way. Jackson Miller wrote: I want to be able to set a base class in a settings file, and then have other classes extend the base class, but PHP won't let me do what I have tried. I get the following error: Fatal error: Class cepweb: Cannot inherit from

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
On Thursday 30 October 2003 12:29 pm, Marek Kilimajer wrote: php is not c, you can't use constants this way. but why? Is there a work around? -Jackson Jackson Miller wrote: I want to be able to set a base class in a settings file, and then have other classes extend the base class, but

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable: ?php // settings to be set on install of the app $MY_BASE_CLASS=base_class; define(MY_BASE_CLASSFILE,base_class.php); // require the class file

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
On Thursday 30 October 2003 01:27 pm, Marek Kilimajer wrote: Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable: I thought that too, and tried it before posting to the list (it was at the bottom of my first email).

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
Jackson Miller wrote: On Thursday 30 October 2003 01:27 pm, Marek Kilimajer wrote: Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable: I thought that too, and tried it before posting to the list (it was at the

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
On Thursday 30 October 2003 02:15 pm, Marek Kilimajer wrote: Can you show it once again. In your first email you use a constant, not variable. Sure. In my first email I said that I had tried with a variable too (but didn't show the code). Ex1 gives a cannot inherit from undefined class error

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Boyan Nedkov
Hey guys, you can extend a _class_ from an existing _class_ but not from a _string_constant_ (Ex1 - MY_BASE_CLASS is evaluated to constant of type string) neither from a _string_variable_ (Ex2 - $my_base_class_var is a variable of type string). To be able to use different base classes with the

[PHP] PHP OOP

2003-10-01 Thread Geoff Hellstrand
I'm working for the first time with object orientated programming in php and I can't figure out how to access elements or methods when you place objects inside objects inside other objects. my origonal idea was to use the following syntax: $a-b-c but this just returns: $a-b . -c Please, need

RE: [PHP] PHP OOP

2003-10-01 Thread Daniel Purdy
[snip]I'm working for the first time with object orientated programming in php and I can't figure out how to access elements or methods when you place objects inside objects inside other objects. my origonal idea was to use the following syntax: $a-b-c but this just returns: $a-b . -c Please,

Re: [PHP] PHP OOP

2003-10-01 Thread Raquel Rice
On Tue, 30 Sep 2003 19:00:18 -0400 Geoff Hellstrand [EMAIL PROTECTED] wrote: I'm working for the first time with object orientated programming in php and I can't figure out how to access elements or methods when you place objects inside objects inside other objects. my origonal idea was to

Re: [PHP] PHP OOP

2003-10-01 Thread Tom Rogers
Hi, Wednesday, October 1, 2003, 9:00:18 AM, you wrote: GH I'm working for the first time with object orientated programming in php and GH I can't figure out how to access elements or methods when you place objects GH inside objects inside other objects. GH my origonal idea was to use the

[PHP] oop problems code

2003-09-18 Thread ORLANDO POZO
Hello, mailing list, I have problem with this oop code: ? class Person { var $name, $address, $age; function Person($name, $address, $age) { $this-name = $name; $this-address = $address; $this-age = $age; } } Class Employee extends Person { var $position, $salary; function

Re: [PHP] oop problems code

2003-09-18 Thread Leif K-Brooks
ORLANDO POZO wrote: Hello, mailing list, I have problem with this oop code: [snip bad code] -- the output of it is: [snip output]

<    1   2   3   4   >