CakePHP a class that can be used anywhere? -


i have multi-domain site. depending on domain site needs behave accordingly.

i created helper called companyinfo has methods such name(), phone(), email(), etc.

depending on domain on returns correct information.

so example if need display phone number user call use $this->companyinfo->phone() , display correct phone number user depending on domain.

ok, good, not relevant. real issue is, need information in more view. helpers views though. if want access information controller need create component it.

i don't want have helper , component doing same thing. rather have 1 class handle rather copy , paste logic.

so whats best way have class methods can accessed controller or view or model?

is kind of static information (name, phonenumber, email, etc) need display? why not add them configuration in core.php?

something like

# in core.php configuration::write('company.name', 'acme corp.'); configuration::write('company.email', 'joe@acme.com'); 

you can info anywhere need using

configuration::read('company.name'); 

Comments