Entities/Administrators/View/AdministratorsView.php
public function insertView(Request $request, Response $response, $args)
    {
        $formAction = $this->router->pathFor(SlimPostgres::getRouteName(true, $this->routePrefix, 'insert', 'post'));
        $fieldValues = ($request->isPost() && isset($args[SlimPostgres::USER_INPUT_KEY])) ? $args[SlimPostgres::USER_INPUT_KEY] : [];

        return $this->view->render(
            $response,
            'Admin/form.php',
            [
                'title' => $this->administratorsEntityMapper->getInsertTitle(),
                'form' => (new AdministratorInsertForm($formAction, $this->container, $fieldValues))->getForm(),
                'navigationItems' => $this->navigationItems
            ]
        );
    }
public function insertView(Request $request, Response $response, $args)
    {
        $formAction = $this->router->pathFor(SlimPostgres::getRouteName(true, $this->routePrefix, 'insert', 'post'));
        $fieldValues = ($request->isPost() && isset($args[SlimPostgres::USER_INPUT_KEY])) ? $args[SlimPostgres::USER_INPUT_KEY] : [];

        return $this->view->render(
            $response,
            'Admin/form.php',
            [
                'title' => $this->administratorsEntityMapper->getInsertTitle(),
                'form' => (new AdministratorInsertForm($formAction, $this->container, $fieldValues))->getForm(),
                'navigationItems' => $this->navigationItems
            ]
        );
    }
public function insertView ( Request $ request , Response $ response , $ args ) { $ formAction = $ this -> router -> pathFor ( SlimPostgres :: getRouteName ( true , $ this -> routePrefix , 'insert' , 'post' ) ) ; $ fieldValues = ( $ request -> isPost ( ) && isset ( $ args [ SlimPostgres :: USER_INPUT_KEY ] ) ) ? $ args [ SlimPostgres :: USER_INPUT_KEY ] : [ ] ; return $ this -> view -> render ( $ response , 'Admin/form.php' , [ 'title' => $ this -> administratorsEntityMapper -> getInsertTitle ( ) , 'form' => ( new AdministratorInsertForm ( $ formAction , $ this -> container , $ fieldValues ) ) -> getForm ( ) , 'navigationItems' => $ this -> navigationItems ] ) ; }
this can be called for both the initial get and the posted form if errors exist (from controller)
this can be called for both the initial get and the posted form if errors exist ( from controller )