This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
I'm getting a blank page #174
Comments
Blank page? |
@Wilt - The status code is 200 and the errors is enabled. |
@viyirenov did you figure out how to fix? |
This repository has been closed and moved to laminas-api-tools/api-tools; a new issue has been opened at laminas-api-tools/api-tools#19. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been trying to use apigility with doctrine for a long time now, but due the updates it was really hard to find a compatible version and now I'm having a weird behavior.
I will put all the steps I made here so you can reproduce and see for yourself.
The problem here is: I have doctrine orm module installed, configured, and I'm getting the information, it's returning everything if I
var_dump
orprint_r
, however when I try to pass that information (array) viareturn $users
on the resource method, all that appears is a blank page.1 - Install the apigility version 1.3.1 (The only version that composer didn't screamed with doctrine orm module compatibility errors):
composer create-project -sdev zfcampus/zf-apigility-skeleton:^1.3.1
2 - Update using composer (the --lock is to make sure it won't update to the latest versions and mess everything up)
composer update --lock
3 - Put the doctrine requirement on your
composer.json
:4 - Update using composer, again in order to add the doctrine to the vendor folder - and to the lock file as well:
composer update --lock
5 - Put the necessary modules information in order to load the modules -
config/modules.config.php
:6 - Creating the necessary configuration files:
config/autoload/doctrine-orm.global.php
:config/autoload/doctrine-orm.local.php
:7 - Enter in development mode:
php public/index.php development enable
8 - Creating the domain model module (
User
- under module folder):module/User/config/module.config.php
:module/User/src/User/Entity/User.php
:9 - Create the table on the database based on the entity:
php public/index.php orm:schema-tool:create
10 - Start apigility server and create an API called
API
and a REST service calledUsers
:php -S 0.0.0.0:8080 -t public public/index.php
11 - Change the files apigility created:
module/API/src/API/V1/Rest/Users/UsersResource.php
:module/API/src/API/V1/Rest/Users/UsersResourceFactory.php
:module/API/src/API/V1/Rest/Users/UsersCollection.php
:Now, if i try to access:
127.0.0.1:8080/users
all that I got is a blank page. The weird thing is that doctrine is returning everything from the database, just enter onUsersResource::fetchAll()
and addvar_dump($users)
you will see that the array is there with all the values.What is happening, anyone knows?
The text was updated successfully, but these errors were encountered: