/** * Call block method based on form field * * @param string $field * @return null|string */ protected function _callBlockMethod($field) { switch ($field) { case 'name': return $this->_block->getUserName(); case 'email': return $this->_block->getEmail(); default: return null; } }