
ReflectionExtension::__construct 메서드는 Extension 클래스의 인스턴스를 생성하고 초기화하는 역할을 합니다. 초기화란 Extension 클래스의 프로퍼티를 초기화하는 것을 의미합니다.
이 메서드 내에서 사용되는 여러 프로퍼티의 초기화는 다음과 같습니다.
- $this->module_name : 모듈 이름을 초기화합니다.
- $this->module_version : 모듈 버전을 초기화합니다.
- $this->module_description : 모듈 설명을 초기화합니다.
- $this->module_author : 모듈作者를 초기화합니다.
- $this->module_license : 모듈 라이선스를 초기화합니다.
- $this->module_functions : 모듈 함수를 초기화합니다.
- $this->module_hooks : 모듈 훅을 초기화합니다.
- $this->module_actions : 모듈 액션을 초기화합니다.
- $this->module_menu_items : 모듈 메뉴 아이템을 초기화합니다.
- $this->module_css_files : 모듈 CSS 파일을 초기화합니다.
- $this->module_js_files : 모듈 JS 파일을 초기화합니다.
- $this->module_php_files : 모듈 PHP 파일을 초기화합니다.
- $this->module_files : 모듈 파일을 초기화합니다.
- $this->module_dir : 모듈 디렉토리를 초기화합니다.
- $this->module_url : 모듈 URL을 초기화합니다.
- $this->module_path : 모듈 경로를 초기화합니다.
- $this->module_base_url : 모듈 기본 URL을 초기화합니다.
- $this->module_base_path : 모듈 기본 경로를 초기화합니다.
- $this->module_base_dir : 모듈 기본 디렉토리를 초기화합니다.
이러한 프로퍼티들은 모듈의 정보를 초기화하는 데 사용됩니다.
이 메서드를 사용하는 예제는 다음과 같습니다.
#hostingforum.kr
php
class MyExtension extends Extension {
public function __construct() {
parent::__construct();
$this->module_name = 'My Extension';
$this->module_version = '1.0';
$this->module_description = 'My Extension description';
$this->module_author = 'John Doe';
$this->module_license = 'MIT';
// ...
}
}
이 예제에서는 MyExtension 클래스의 생성자 메서드에서 모듈의 정보를 초기화합니다.
2025-03-08 10:13