Hi there,
I am new to PHP classes and I do want to access a variable outside the
class, but somehow that does not work. global also does not have any effect.
In the following example I would like to be able to access $dbh from
inside the class like I did in that example. This does not work. C
Refer to the global on the constructor.
Anyway, using a global like that is not a good practice. Just pass the
variable to the constructor.
2007/9/29, Merlin <[EMAIL PROTECTED]>:
>
> Hi there,
>
> I am new to PHP classes and I do want to access a variable outside the
> class, but somehow that doe
At 12:36 PM -0500 9/28/07, Edward Vermillion wrote:
My question was more mental prodding than anything else. The OP had
a function to convert incoming text into UTF-8 before they did
anything with it. A couple of folks said that was unnecessary, if
you set your form to UTF-8 your incoming data
Merlin,
if you are using php5 the var keyword is no longer valid; that was used in
classes in php4.
if you want to structure your classes properly you need to study PPP
(public, private, protected) access modifiers.
typically member variables are declared to be private or protected, if there
will
Yes, I know how to Google, and I've been Googling...
But I would appreciate advice about good beginner tutorials using
classes in PHP4 based on your actual experiences. I.e., have some of
you found tutorials that really unlocked the doors for you?
Ideally, such tutorials would have somewhat reali
Jeff Cohan wrote:
> Yes, I know how to Google, and I've been Googling...
>
> But I would appreciate advice about good beginner tutorials using
> classes in PHP4 based on your actual experiences. I.e., have some of
> you found tutorials that really unlocked the doors for you?
>
> Ideally, such tut
Greg -
Greg Maruszeczka wrote:
> Jeff:
> The following books really helped me get my head around basic
> OOP and design patterns in PHP, especially the first one
> which directly addresses both PHP4 and PHP5:
>
> 1. PHP Architect's Guide to PHP Design Patterns, Jason E.
> Sweat, PHP Architect
> From: [EMAIL PROTECTED]
> Today's post was
> prompted by my desire to prototype yet another suite of
> browse-read-edit-add-delete functions for someone.
I was just going to ask you what is BREAD. Cool, basically a Web-based CRUD?
I can't find anything on it, can you point me to some sites?
On 9/30/07, 潘志彬 <[EMAIL PROTECTED]> wrote:
>
> $dbh = 'test';
>
> class search_helper extends AjaxACApplication
> {
> /**
> * Database connection details
> */
>
>// announce global variable before use it
>global $dbh;
>
> $db_hostname = $dbh;
$dbh = 'test';
class search_helper extends AjaxACApplication
{
/**
* Database connection details
*/
// announce global variable before use it
global $dbh;
$db_hostname = $dbh;
...
Regards,
Ryu
2007/9/29, Merlin <[EMAIL PROTECTED]>:
tedd wrote:
At 8:30 PM -0400 9/27/07, brian wrote:
I wasn't bitching! And i *thought* that my numerous attempts at
explaining such would have been enough. Obviously not, but wtf can you
do with people who seem to want only to stir up shit?
It sure sounded like you were bitching.
Gee, thanks
although some people believe differently than i; i would argue
trying to learn how to design w/ the classes that php4 provides
is a waste of time. most books you will find regarding object oriented
design assume the language has the basic constructs. ppp mainly.
also, there are other important fa
painfully i find myself bound to it at my current job. there ive been able
to
realize that proper oop can be used to an amazing extent in php4, however
altogether i wish we could just move on to 5 and i could stop writing in
// private
as a comment :)
-nathan
On 9/30/07, Jeff Cohan <[EMAIL PROTE
Nathan Nobbe wrote:
>
> although some people believe differently than i; i would argue
> trying to learn how to design w/ the classes that php4 provides
> is a waste of time. most books you will find regarding object oriented
> design assume the language has the basic constructs. ppp mainly.
> a
Instruct ICC wrote:
> > From: [EMAIL PROTECTED]
> > Today's post was
> > prompted by my desire to prototype yet another suite of
> > browse-read-edit-add-delete functions for someone.
>
> I was just going to ask you what is BREAD. Cool, basically a
> Web-based CRUD? I can't find anything on it,
15 matches
Mail list logo