Mohammad Mehdi Habibi
Mohammad Mehdi Habibi

Reputation: 1623

How to get baseUrl in ZF2 model?

I run a zf2 application in localhost/zf2 locally. I want to retrieve the application base URL(for example http://localhost/) in my model.

How can I get the localhost part of URL in model?

Or, how I recognize the project is online or offline?

Upvotes: 1

Views: 594

Answers (1)

Dinuka Thilanga
Dinuka Thilanga

Reputation: 4330

It is wrong with MVC architecture. If u want use baseUrl in model, pass baseUrl to model from controller.

But I also was add question to do that when i use ZF1. Sometime it will useful for you.

Get base url in model

Upvotes: 1

Related Questions