Search Result

Collapse
7 results in 0.0023 seconds.
Keywords
Members
Tags
oop
  •  

  • Is this class unsafe to use in my public PHP-scripts?

    I have no idea if it's safe to use or not, so I have to ask you.

    Code:
    	class Requests {
    		private $type;
    		public function __construct($type='') {
    			$this->type = strtolower($type);
    			$this->createObject();
    		}
    		private function createObject() {
    			switch($this->type) {
    				case 'post':
    					$arr = $_POST;
    					break;
    				case 'get':
    					$arr = $_GET;
    ...
    See more | Go to post

  • Dormilich
    started a topic which OOP Pattern to use
    in PHP

    which OOP Pattern to use

    I’m not that good with OOP Patterns, so I better ask before I code in the wrong direction.

    the scenario is quite simple, I have a DB table which holds different types of text (designated by a type field), based on that type I need a class (I usually fetch the DB result in a class) to use different output templates.

    I’m pretty sure there is a Pattern for exactly that purpose, just which one? Strategy, State, Template...
    See more | Go to post

  • zubair1
    started a topic PHP OOP Help
    in PHP

    PHP OOP Help

    Hello,

    I just recently started to switch to OOP in PHP, but am getting confused on almost every step :(

    Right now, my current issue is i have this function:

    Code:
    	public function create() {
    		global $database;
    		$attributes = $this->sanitized_attributes();
    
    		$sql = "INSERT INTO ".self::$table_name." (";
    		$sql .= join(", ", array_keys($attributes));
    ...
    See more | Go to post

  • Reference external class from Windows Form

    Hopefully this hasn't been asked already - apologies if so

    I have a Windows Form running inside C# - built using the form designer

    I've built a number of methods inside the form Events which I now want to strip out into External class files (in order to try and make the app a bit more architecturally correct so to speak).

    To do this, I have created a new Project which I've added to the Solution.
    ...
    See more | Go to post

  • Preventing controls enable property from changing

    Hi Everyone,
    I m implementing control based security in my application. where i m saving controlname (per form) in database, which are to be restricted.

    So far I have implemented the security and restricted control get disabled.Now what i want to do is that i have to prevent that for those controls the "control.Enable " property should not change. how can i restrict that.

    I have achieved the functionality...
    See more | Go to post

  • mrjohn
    started a topic What is "this" in object constructors?

    What is "this" in object constructors?

    Hullo, I've been learning C# and I had a question. I'm creating a class, and I was writing the constructor. When I was assigning values to it's variables, I found that the compiler seems to take it both with and without the "this" keyword. Does it make a difference whether I use it or not?

    [CODE=C#]public class Car
    {
    private float weight, gasTank;
    public Car(float myWeight, float myGasTank)...
    See more | Go to post

  • mrjohn
    started a topic How do you remove objects?

    How do you remove objects?

    Hey!

    I'm working on a javascript project which will run on a single html page, and I'm using lots of objects. The program will create new instances of these objects during runtime. However, for efficiency, I need a way to get rid of the old ones. Is there any way to do this?
    See more | Go to post
Working...