Передача регистра из одного класса в другой
Рекомендованные сообщения
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу.
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Я правильно понимаю концепцию ипс и ООП о передаче регистра из класса в класс?
class lofi { public function __construct( ipsRegistry $registry ) { $this->registry = $registry; $this->DB = $this->registry->DB(); ..... } public function init() { $this->skin = new lofi_skin( $this->registry ) } } class lofi_skin { public function __construct( ipsRegistry $registry ) { $this->registry = $registry; $this->DB = $this->registry->DB(); } } $registry = ipsRegistry::instance(); $registry->init(); $lofi = new lofi( $registry ); $lofi->init();Или можно как-то по другому? :)