{"record":{"id":"f32b6956bd4d2f9d","repo":"phalcon/cphalcon","slug":"there-is-no-form-with-name-name","errorCode":null,"errorMessage":"There is no form with name='{name}'","messagePattern":"There is no form with name='(.+?)'","errorType":"exception","errorClass":"Phalcon\\Forms\\Exceptions\\FormNotRegistered","httpStatus":null,"severity":"error","filePath":"phalcon/Forms/Manager.zep","lineNumber":69,"sourceCode":"    public function create(string name, entity = null) -> <Form>\n    {\n        var form;\n\n        let form = new Form(entity),\n            this->forms[name] = form;\n\n        return form;\n    }\n\n    /**\n     * Returns a form by its name\n     */\n    public function get(string name) -> <Form>\n    {\n        var form;\n\n        if unlikely !fetch form, this->forms[name] {\n            throw new FormNotRegistered(name);\n        }\n\n        return form;\n    }\n\n    /**\n     * Returns the FormsLocator instance.\n     */\n    public function getLocator() -> <FormsLocator>\n    {\n        return this->locator;\n    }\n\n    /**\n     * Checks if a form is registered in the forms manager\n     */\n    public function has(string name) -> bool\n    {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Forms/Manager.zep#L51-L87","documentation":"Phalcon\\Forms\\Manager::get() fetches a form previously stored under a name via create() or set(); it does a strict fetch on the internal forms map and throws FormNotRegistered when no form was stored under that key.","triggerScenarios":"Calling $manager->get('checkout') before $manager->create('checkout', new CheckoutForm()) or $manager->set('checkout', $form) ran; a typo or case difference between the registration key and the lookup key.","commonSituations":"Multi-step flows where the form is created in one controller action and fetched in another but the name drifted; a shared Manager service used across modules with inconsistent key naming; register and lookup done in different case styles.","solutions":["Register the form before fetching: $this->forms->set('checkout', new CheckoutForm())","Guard the lookup: if ($manager->has('checkout')) { $form = $manager->get('checkout'); }","Centralize form names as class constants used by both the creator and the consumer"],"exampleFix":"// before\n$form = $this->forms->get('checkout'); // never created\n\n// after\n$this->forms->set('checkout', new CheckoutForm());\n$form = $this->forms->get('checkout');","handlingStrategy":"validation","validationCode":"if ($manager->has($name)) {\n    $form = $manager->get($name);\n} else {\n    $form = new DefaultForm();\n    $manager->set($name, $form);\n}","typeGuard":null,"tryCatchPattern":"try {\n    $form = $manager->get($name);\n} catch (\\Phalcon\\Forms\\Exceptions\\FormNotRegistered $e) {\n    // lazily build and register the form on first access\n    $form = new DefaultForm();\n    $manager->set($name, $form);\n}","preventionTips":["Define form names as constants shared between creator and consumer code","Register all long-lived forms during module boot instead of on demand in actions","Prefer lazy create-and-set in the catch path for multi-step flows"],"tags":["phalcon","forms","manager","registry","service-not-registered"],"backgroundTag":"service-not-registered","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}