Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は 2 つの php ファイルを持っています: main.class.php form.class.php
これらのファイルには、ファイル名と同じ名前を持つ 2 つのクラスがあり、クラス フォームはメイン クラスから拡張されます メイン クラスにはコンストラクターがあります クラス フォームのコンストラクター メソッドを設定するにはどうすればよいですか?
class Main { private $foo; public function __construct($foo) { $this->foo = $foo; } } class Form extends Main { private $bar; public function __construct($foo, $bar) { parent::__construct($foo); $this->bar = $bar; } }