Tag Archives: class

Can we create an object of a class inside another class in php?

Can we create an object of a class inside another class in php?I hav made a small application in php,now I am trying to convert the entire code in a class-methods-object fashion.I m now Confused.… Continue reading

Tagged , , | Leave a comment

PHP Class Extension Exceeds RAM – CodeIgniter

I am modifying the model class by completely replacing it. I also wanted to break most of the components in different classes and to be loaded when they are needed. This particular class has to be loaded in the constructor.… Continue reading

Tagged , , , , | 1 Comment

Class Loading Its Extensions by itself – PHP

Here is my problem.
It also comes with the next error.
*It’s not important, I am adding it instead of tags for search engines.
Call to a member function hi() on a non-object in
/path/to/your/application/test.php on
line 59

class Class_B{

     

Continue reading

Tagged , , , , | Leave a comment

PHP Warnings, Notices and Errors

Hey guys I’m getting three things right now that I’m trying to take care of, and hoping you can help. I have and error, a warning, and a notice in my code that I would like to patch up and… Continue reading

Tagged , , , , | Leave a comment

Sending jquery ajax variable to a PHP class

I am using a php class to generate drop down boxes dynamically. But page was refreshing every time. But now i am trying to change it to ajax and i want to send ajax variable via post method. but the… Continue reading

Tagged , , , | Leave a comment

Intermittent Re-sizing Image Issue

I’m uploading images via stream_copy_to_stream() and then re-sizing them using the class and method below.
This is my resize class: http://pastebin.com/wtbcbfzv
I’m using it like so.

$resizeObj = new resize('image.jpg');
$resizeObj -> resizeImage(960, 800, 'auto');
$resizeObj -> saveImage('image.jpg', 100);

However Continue reading

Tagged , , , | Leave a comment

php class to inherit only one method

I have these classes:

class User{
    private $user_ID;
    private $first_name;
    private $surname;
    ...

    private $website;
    private $company;

    function __construct($array){
        $this->user_ID            = $array["userId"];
        $this->first_name         = $array["first"];
        $this->surname            = $array["last"];
        $this->telephone          = $array["tele"];
        ...
    }
    public function addWebsite($array){
        $this->website = $array;
    }
    

Continue reading

Tagged , , , | 2 Comments

PHP OOP Design Pattern

I recently read an article on Wikipedia about Design Pattern
So far I’ve done this, but it returns Fatal error: Maximum function nesting level of '100' reached, aborting!…
Logically I know, it will return nesting error, But, I don’t understand Continue reading

Tagged , , , , | 1 Comment

how to get input parameters of any method of a class in PHP?

Let’s say I have a class with 10 methods, each method has different parameters.
I want to log input parameters of all methods of said class without having to do edit each method to insert that logging code. Is there… Continue reading

Tagged , , , | Leave a comment

PHP Variables, classes and inheritance understanding the basics

I am working on a PHP project and I need some help with the basics. I have a Vehicle class. Within the vehicle class there is a variable called fuel_capacity. As you would expect the fuel capacity changes from vehicle… Continue reading

Tagged , , , | Leave a comment
12 pages