Richard Lynch wrote:
But I don't think you can even *DO* an include() inside a class
definition, so that should be giving you an error...
You can do an include/require anywhere. However, you cannot declare new
functions inside an include and use it to add methods or variables to a
class.
--
# [EMAIL PROTECTED] / 2006-10-16 12:47:47 -0500:
> On Sat, October 14, 2006 5:18 pm, Kevin Waterson wrote:
> >>>class returnConfigParams
> >>> {
> >>>
> >>> var $a;
>
> >>> function getMySQLParams()
> >>> {
> >>>include($_SERVER['DOCUMENT_ROOT']."/properties.php");
> >>>
> >>>$values =
On Sat, October 14, 2006 5:18 pm, Kevin Waterson wrote:
>>>class returnConfigParams
>>> {
>>>
>>> var $a;
>>> function getMySQLParams()
>>> {
>>>include($_SERVER['DOCUMENT_ROOT']."/properties.php");
>>>
>>>$values = array(0 => $a, 1 => $b, 2 => $c, 3 => $d);
You probably want $this->a
On Sat, October 14, 2006 9:55 am, AR wrote:
> $params_file = New returnConfigParams;
> $params_file->getMySQLParams();
> print($params_file[0]);
>
> but doesn't work :(
>
> Help me please.
>
> I'm stuck on this for two hours and didn't find nothing on Google that
> could help me.
There's nothing w
On Sunday 15 October 2006 03:19, AR wrote:
> Hi,
>
> > If you have an array assigned to a variable, you access elements of it
> > with [].
> >
> > $foo = array('a', 'b', 'c');
> >
> > print $foo[0]; // gives 'a'
> >
> > $bar = array('a' => 'hello', 'b' => 'world');
> >
> > print $foo['b']; // gives
Hi,
> If you have an array assigned to a variable, you access elements of it with
> [].
>
> $foo = array('a', 'b', 'c');
>
> print $foo[0]; // gives 'a'
>
> $bar = array('a' => 'hello', 'b' => 'world');
>
> print $foo['b']; // gives 'world'
I know that.
I had my class written as:
---
On Saturday 14 October 2006 19:09, AR wrote:
> Hello,
>
> I've rewritten my class as you told me:
>
> --
> class returnConfigParams
>
> {
>
> private static $instance = NULL;
>
> var $a;
> var $b;
> var $c;
> var $d;
>
> private
Hello,
I've rewritten my class as you told me:
--
class returnConfigParams
{
private static $instance = NULL;
var $a;
var $b;
var $c;
var $d;
private function __construct() {
}
// function that get the database pa
This one time, at band camp, Roman Neuhauser wrote:
BTW, here is my class:
class returnConfigParams
{
var $a;
var $b;
var $c;
var $d;
function getMySQLParams()
{
include($_SERVER['DOCUMENT_ROOT']."/properties.php");
$values = array(0 => $a, 1 => $b, 2 => $c, 3 =
# [EMAIL PROTECTED] / 2006-10-14 16:42:37 +0100:
> > Just like you'd access members of any other array.
> >
> > $whatever = $params_file->getMySQLParams();
> > print($whatever[0]);
> >
> > This is a matter of basic rules of the language. Did you know
> > most of the grammer is
Hello,
> Just like you'd access members of any other array.
>
> $whatever = $params_file->getMySQLParams();
> print($whatever[0]);
>
> This is a matter of basic rules of the language. Did you know
> most of the grammer is described in the manual?
Sure, i already tried that, b
# [EMAIL PROTECTED] / 2006-10-14 16:28:57 +0100:
> Hello,
>
> >> I have this class named "returnConfigParams" that returns an array
> >> called "$values" through a function called "getMySQLParams()".
> >>
> >> My question is how to retrieve the values of the array from the file
> >> that calls the
Hello,
>> I have this class named "returnConfigParams" that returns an array
>> called "$values" through a function called "getMySQLParams()".
>>
>> My question is how to retrieve the values of the array from the file
>> that calls the class.
>>
>> I have:
>>
>> $params_file = New returnConfigPara
# [EMAIL PROTECTED] / 2006-10-14 15:55:57 +0100:
> Hello,
>
> Sorry for the newbie question :(
>
> I have this class named "returnConfigParams" that returns an array
> called "$values" through a function called "getMySQLParams()".
>
> My question is how to retrieve the values of the array from t
Hello,
Sorry for the newbie question :(
I have this class named "returnConfigParams" that returns an array
called "$values" through a function called "getMySQLParams()".
My question is how to retrieve the values of the array from the file
that calls the class.
I have:
$params_file = New return
15 matches
Mail list logo