Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

One controller to load the same form (empty or populated)

$
0
0
1. I'd like to create one controller to add or edit article and load only one view (empty form or populated form)

The code I've attached works and it's close to what I want but it has two different views with the same form and two controllers for add and edit data.

2. What happens when user sends the form? Let's say we have field with name="username" value="some_value"
How can I retrieve some_value in view file? Is it a variable or an array?



Can you help please?

.php   Article.php (Size: 2.8 KB / Downloads: 1)

.php   Article_model.php (Size: 1.12 KB / Downloads: 1)

.php   add.php (Size: 555 bytes / Downloads: 2)

.php   edit.php (Size: 917 bytes / Downloads: 2)

.php   index.php (Size: 510 bytes / Downloads: 1)

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>