./categories/back-end
PHP 객체 멤버 접근 연산자
-> (객체 멤버)
class test {
var $a; // PHP4식; 현재는 public
var $b;
function aaa() {
$this->a = "알파벳";
}
}
$obj = new test;
echo $obj->a;
$tmp = $obj->aaa();
$obj->a= 객체$obj의 멤버$a$this: 메소드 안에서 자기 객체
체이닝
$this->cut_str_size = $data->info->cut_str_size;
DB 결과가 객체(mysql_fetch_object() 등)면 필드도 ->필드명.
:: (static / Scope Resolution)
$tmp->url = zUrl::getViewUrl($tmp->article_srl);
인스턴스 없이 클래스 static 멤버에 접근.
관련 링크: http://jobdahan.net/language_php/17384
./comments