# Embed Express Form block inside Express Entry List Block, plus modify form field and insert data

**URL:** https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900
**Category:** Developing with Concrete
**Created:** [January 25, 2023, 4:55pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900 "2023-01-25T16:55:49Z")
**Posts on this page:** 5
**Page:** 4

<div class="post-metadata">

### Author: ![Parasek](https://forums.concretecms.org/user_avatar/forums.concretecms.org/parasek/32/4286_2.png) [@Parasek](https://forums.concretecms.org/u/Parasek)
#### Post date: [April 25, 2023, 6:22pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900/61 "2023-04-25T18:22:31Z")

</div>

You can structure it however you want that makes most sense for you.

You can keep code for every form in different package or keep them in one (you could consider changing namespace/package name to something more general).

You can change it to something like (when you move existing code to `src/tournament_registration` folder):

```php
protected $pkgAutoloaderRegistries = [
    'src/tournament_registration' => 'TournamentRegistrationForm',
    'src/folder_two' => 'OtherNamespace',
];

```

and it will be used as:

```php
namespace OtherNamespace;

```

and so on.

You can also change package name/namespaces in files (though it will require basic understaning of namespaces in PHP):

```php
protected $pkgAutoloaderRegistries = [
    'src' => 'FormModifications',
];

```

and keep all files in src like now. You can add next controllers/overrides etc., just stick to sensible naming convention, so you won’t be lost later.

---

<div class="post-metadata">

### Author: ![BloodyIron](https://forums.concretecms.org/user_avatar/forums.concretecms.org/bloodyiron/32/3807_2.png) [@BloodyIron](https://forums.concretecms.org/u/BloodyIron)
#### Post date: [April 25, 2023, 6:30pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900/62 "2023-04-25T18:30:37Z")

</div>

> [@Parasek](#):
>
> You can also change package name/namespaces in files (though it will require basic understaning of namespaces in PHP):
> 
> ```auto
> protected $pkgAutoloaderRegistries = [
> 'src' => 'FormModifications',
> ];
> 
> ```
> 
> and keep all files in src like now. You can add next controllers/overrides etc., just stick to sensible naming convention, so you won’t be lost later.

I’m not entirely following you on your explanation of this part. I’m not sure how from a structured perspective this would translate into how I use this (as in, being called in PHP), and the logical folder structure this would then lead to requiring. I do see this results in /src/somethingOrOther, but the somethingOrOther and execution/usage of such isn’t yet visible to me.

I do for sure want to use good habits, sensible naming conventions, stuff like that, so I appreciate your advice on this. :^)

And yes, in this particular case the package has a whole bunch of different things, and one of them is the Tournament Registration Form, plus already like 7 templates, and more to be expected. hehe.

As an aside, I’ve been able to get my second form working with your provided code, yay! Just need to style it now, hehe. Thanks again for all your help!

---

<div class="post-metadata">

### Author: ![Parasek](https://forums.concretecms.org/user_avatar/forums.concretecms.org/parasek/32/4286_2.png) [@Parasek](https://forums.concretecms.org/u/Parasek)
#### Post date: [April 25, 2023, 6:41pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900/63 "2023-04-25T18:41:43Z")

</div>

You can have multiple files like:

```auto
TournamentRegistrationForm\Express\Controller\TournamentRegistrationFormController
TournamentRegistrationForm\Express\Controller\OtherFormController
TournamentRegistrationForm\Express\Controller\ThirdFormController

```

and bind each one to different form in `on_start()`. Each controller will do its own stuff.  
In this case `TournamentRegistrationForm` namespace doesn’t make much sense, better to use it as something like:

```auto
FormModifications\Express\Controller\TournamentRegistrationFormController
FormModifications\Express\Controller\OtherFormController
FormModifications\Express\Controller\ThirdFormController

```

Though you can leave it as `TournamentRegistrationForm` if it doesn’t bother you.

---

<div class="post-metadata">

### Author: ![BloodyIron](https://forums.concretecms.org/user_avatar/forums.concretecms.org/bloodyiron/32/3807_2.png) [@BloodyIron](https://forums.concretecms.org/u/BloodyIron)
#### Post date: [April 25, 2023, 6:46pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900/64 "2023-04-25T18:46:29Z")

</div>

Are you describing how PHP invokes each controller? Or how they are stored “on-disk” so to say?

Here’s the impression I get from your most recent explanation:

In /controller.php:

```auto
protected $pkgAutoloaderRegistries = [
    'src' => 'FormModifications',
];

```

And then, “on-disk” we have:

```auto
/src/FormModifications/Express/Controller/TournamentRegistrationFormController.php
/src/FormModifications/Express/Controller/OtherFormController.php
/src/FormModifications/Express/Controller/ThirdFormController.php

```

And then when I want to invoke (not even sure I’m using the right term there) I would use…

```auto
FormModifications\Express\Controller\TournamentRegistrationFormController
FormModifications\Express\Controller\OtherFormController
FormModifications\Express\Controller\ThirdFormController

```

How close to “correct” am I here? 🤔

---

<div class="post-metadata">

### Author: ![Parasek](https://forums.concretecms.org/user_avatar/forums.concretecms.org/parasek/32/4286_2.png) [@Parasek](https://forums.concretecms.org/u/Parasek)
#### Post date: [April 25, 2023, 6:55pm UTC](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900/65 "2023-04-25T18:55:12Z")

</div>

For

```auto
protected $pkgAutoloaderRegistries = [
    'src' => 'FormModifications',
];

```

it is like

```auto
/src/Express/Controller/TournamentRegistrationFormController.php

```

and then in files it is used as:

```auto
namespace FormModifications\Express\Controller;
class TournamentRegistrationFormController 
{
}

```

etc.  
Left part of `pkgAutoloaderRegistries ` is location on disk, right part is how it is translated.

[Previous page](https://forums.concretecms.org/t/embed-express-form-block-inside-express-entry-list-block-plus-modify-form-field-and-insert-data/4900.md?page=3)
