Skip to content
This repository has been archived by the owner. It is now read-only.

[WIP] Feature/accepted model controller plugin #2405

Closed
wants to merge 205 commits into from

Conversation

@basz
Copy link
Contributor

basz commented Sep 22, 2012

Proof of Concept & RFC PR

Idea is to be able to determine the appropriate Model within an controller action based on the browser Accept header.

example

$viewModel = $this->acceptedModel();

if ($viewModel instanceof ViewModel) {
     // regular logic
    $viewModel->someForm = $form; 
} 
if ($viewModel instanceof JsonModel) {
     // json logic
    $viewModel->someFormData = $form->getData(); // forms won't serialize to json
} 

return $viewModel;

If people like this I will add a unittest and documentation...

coss and others added 30 commits Aug 2, 2012
- ModuleAutoloader uses now Exception\InvalidArgumentException instead of the built-in InvalidArgumentException
marek.nos
Roy van Kaathoven
Roy van Kaathoven
Add hydrator wildcard to add strategy for all extract/hydrate
Add hydrator strategy with serializer
Add unit tests for wirldcard
Add unit tests for serializable strategy
…ory since it will only cause problems with cyclic dependencies
bakura10 and others added 10 commits Sep 25, 2012
Forward port #2420
@basz

This comment has been minimized.

Copy link
Contributor Author

basz commented Sep 26, 2012

My limited skills in (zf2) software architecturin prevent me from overseeing all consequences. My -fairly simple- plugin seems to be further complicated by the discussion going on in PR #2410 than I anticipated.

RFC please...

@Freeaqingme

This comment has been minimized.

Copy link
Member

Freeaqingme commented Sep 28, 2012

@basz I'm getting back to you this weekend. Lets get this thing done!

@ghost ghost assigned Freeaqingme Sep 28, 2012
Freeaqingme added 2 commits Sep 28, 2012
…ub.com/basz/zf2 into basz-feature/accepted-model-controller-plugin
…-controller-plugin' into feature/accepted-model-controller-plugin
@Freeaqingme

This comment has been minimized.

Copy link
Member

Freeaqingme commented Sep 29, 2012

@basz can it be that something went wrong? Your pr now has many, many more commits and files than it had before.

@basz basz closed this Sep 29, 2012
@Ocramius

This comment has been minimized.

Copy link
Member Author

Ocramius commented on library/Zend/Mvc/Service/DiServiceInitializerFactory.php in 2567c32 Jan 23, 2013

@mwillbanks this one is the evil row. I'm totally for removing it (related to #3537)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.