I have the problem, that I have two controllers. One is a restful controller which only handles json data and returns a JsonModel, and the other one is a default controller which returns a ViewModel Now I have the problem, that my method only returns an array of entities, which is correct for the default controller, but my restful controller
Tag: zend-framework2
zf2 change language dynamically
I have one question, about ZF2 Translator, in the specific case in the costruction the link for change langauge dunamically when user click on flag or menu link. In My Application/config/module.config.php i have this code: and my route is: And in my Application/Module.php i set this code on bootstrap: now my route http://www.xxxx.com/it/index or http://www.xxxx.com/it/company but i can’t create a
Responses is empty while calling web services via zend framework 2.3
I am a newbie in zendframework 2.3. In my app i need to call web services. and i used class ZendHttpClient() … everything is fine… but reponse is empty.. It works in curl call via core php Answer You could use directly the Http Client by setting the CURLOPT_POST and CURLOP_POSTFIELDS options in the Client and not in the Adapter,
ZF2 Apigility Rest – unable to get multiple params
I’m using Apigility to build my Rest APIs. I want to build have the ability to take in multiple parameters. Such as http://mydomain.com/users/1/activities/4 I now this is possible from this page: https://github.com/zfcampus/zf-apigility/issues/10 I have edit my module route to: ‘route’ => ‘/users/:users_id/activities[/:activities_id]’, But, I don’t know how to retrieve users_id from the url. I tried grabbing the params in my
Can’t connect LDAP server – issue in ldap_bind();
I am tried to implement a LDAP authentication in my web application developed in ZF2. LDAP authentication is working fine in Windows 7. But, after moving the application to LINUX machine, LDAP authentication is not working. I am always getting the error as : Warning: ldap_bind(): Unable to bind to server: Can’t contact LDAP server in LdapConnect.php on line 20
Insert and Update data into two tables (Transactions) using Zend framework 2
I need to insert data into one table and references data into another table in ZF2 using tableGateway. For example, when I am registering a user, I have to insert user data into one table and this user hobbies data(Multiple rows) into another table with the references of the inserted user id and Update data also should work. I have
PHP retrieving array values using dash arrow “->”
I’ve been using PHP quite a while now, but never been an advanced programmer. I feel like this is dumb question but never understood why some array values can be retrieved using different methods: This: rather than normal: The standard $array[‘value’] always works, but the one using the -> method doesn’t at times. Why is that? Here’s an example. I
Get mysql table field names in ZF2
I want to store the csv data dynamically into mysql table. According to my csv columns header i want to insert the data into respective columns in mysql table. For this, I need to get all the table fields name from Zend Framework Controller or Model. I have tried with: ** ** But, it shows the error: Fatal error: Class