1
5
Let's say I have three classes. One being the parent and two being "childs". However, I'm not using class - extends -: class root { function root(){ $this->son = new son(); $this->daughter = new daughter(); } } class son...
2010-12-21
9
2
Hey there I'm wondering how this is done as when I try the following code inside a function of a class it produces some php error which I can't catch public $tasks; $this->tasks = new tasks($this); $this->tasks->test(); I don't know w...
2009-09-24
2
3
<?php class gdTemplateDB { [...] function rewrite_dependencies($section, $id) { global $wpdb, $table_prefix; /*var_dump($this); die;*/ **include($this->plugin_path.'code/t2/templates.php');** ...
2011-03-09
0
2
I have a class file: class_xx.php. And then a function file: function_xxx.php In my function_xxx.php: require_once('class_xx.php') ... // after few next lines $object = new class_xx1($arg1, $arg2); But it gives me: Fatal error: Class 'clas...
2010-01-19
0
1
I have two classes : SQL Connection Class class MysqlDB { protected $_mysql; protected $_where = array(); protected $_query; protected $_paramTypeList; public function __construct($host, $username, $password, $db) { $this...
2011-06-27
2
2
Can someone tell me why I cannot write a class as follows <?php class Foo { ?> <?php function bar() { print "bar"; } } ?> I think it's the same as <?php class Foo { function bar() { ...
2010-03-27
2
3
I built myself a MySQL class which I use in all my projects. I'm about to start a project that is heavily based on user accounts and I plan on building my own class for this aswell. The thing is, a lot of the methods in the user class will be MyS...
2010-03-29
1
4
I'm using PHP here, and I have two classes. Can I call a function from one class in the other one. For example: class A { function a_func() { echo "A function"; } } $a = new A(); class B { function b_func() { ...
2011-05-01
1
2
I have a php class that tells time like this (Time.class.php): <?PHP class Time { var $timestamp; function timestamp () { $this->timestamp = date('YmdHis'); return $this->timestamp; } } ?> What I want to do is t...
2011-06-02
4
2
I have a simple PHP class, I'm trying to access a property of that class from a method in that class. I've tried the $this->property_name syntax and that doesn't appear to work. What am I doing wrong? class NavigationBuilder { public $mP...
2011-04-02