ssalc

Card Set Information

Author:
zenner
ID:
245453
Filename:
ssalc
Updated:
2013-11-07 06:56:15
Tags:
fgjfgj fgj
Folders:

Description:
j fgj dfgj fgc
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user zenner on FreezingBlue Flashcards. What would you like to do?


  1. Iniciar uma funcao de uma class rapidamente:
    • class Minha
    • {   
    • public static function suba()   
    • {       
    • return ("SuBa");   
    • }
    • }
    • -------------------------------
    • echo  Minha::suba();
  2. Class
    public
    public scope to make that variable/function available from anywhere, other classes and instances of the object.
  3. Class
    Private
    Private scope when you want your variable/function to be visible in its own class only.
  4. Class
    Protected
    Protected scope when you want to make your variable/function visible in all classes that extend current class including the parent class.
  5. Class
    Static
    • Declarar membros ou métodos de uma classe como estáticos faz deles
    • acessíveis sem precisar instanciar a classe. Um membro declarados como
    • estático não pode ser acessado com um objeto instanciado da classe ($this->funcao) (embora
    • métodos estáticos podem).


    • ex:
    • $resizedImage = Classe::funcao( $image, 300 );
  6. When to use self vs $this
    Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
  7. Passar uma variavel para dentro de uma class sem ser para uma funcao especifica
    • class Minha{   
    • var $casa;   
    • function ran(){       
    • $a = $this->casa + 3;       
    • return ($a);   
    • }   
    • function muro(){       
    • return $this->ran();   
    • }
    • }
    • ---------------------------
    • $a=new Minha();
    • $a->casa=33;
    • echo $a->muro();

What would you like to do?

Home > Flashcards > Print Preview