Hi
Everything in the blog tutorial works fine except for the edit action. Accessing the /blog/edit/id it renders the form well but the fields (text and title) display not data to edit.
Debugging Blog/view/blog/write/form.phtml first 5 lines of code:
$form = $this->form;
xdebug_debug_zval('form');
$fieldset = $form->get('post');
xdebug_debug_zval('fieldset');
The form debug output shows the data to edit:
(refcount=7, is_ref=0)
object(Blog\Form\PostForm)[167]
protected 'attributes' => (refcount=1, is_ref=0)
array (size=3)
'method' => (refcount=1, is_ref=0)string 'POST' (length=4)
'name' => (refcount=1, is_ref=0)string 'postform' (length=8)
'action' => (refcount=1, is_ref=0)string '/is/blog/edit/1' (length=15)
...
protected 'object' => (refcount=2, is_ref=0)
object(Blog\Model\Post)[246]
private 'id' => (refcount=2, is_ref=0)string '1' (length=1)
private 'text' => (refcount=2, is_ref=0)string 'Welcome to my first blog post' (length=29)
private 'title' => (refcount=2, is_ref=0)string 'Blog #1' (length=7)
but the debug output of the fieldset does not:
(refcount=3, is_ref=0)
object(Blog\Form\PostFieldset)[173]
protected 'factory' => (refcount=3, is_ref=0)
object(Zend\Form\Factory)[169]
protected 'inputFilterFactory' => (refcount=0, is_ref=0)null
protected 'formElementManager' => (refcount=4, is_ref=0)
object(Zend\Form\FormElementManager\FormElementManagerV3Polyfill)[60]
protected 'aliases' => (refcount=1, is_ref=0)
array (size=72)
...
protected 'object' => (refcount=1, is_ref=0)
object(Blog\Model\Post)[193]
private 'id' => (refcount=0, is_ref=0)null
private 'text' => (refcount=1, is_ref=0)string '' (length=0)
private 'title' => (refcount=1, is_ref=0)string '' (length=0)
protected 'useAsBaseFieldset' => (refcount=0, is_ref=0)boolean false
I rechecked the code with the one in the tutorial and is identical.
What could have I missed?