Skip to main content

Glossary

What Is a Controller

A controller is the part of an application that handles incoming requests and decides what to do with them. Learn what controllers do in web software.

Definition

A controller is a piece of code that receives a request, processes it, and sends back a response. When a user clicks a button or a system sends data to your application, a controller is typically the first thing that handles it. The controller decides what needs to happen -- whether that means fetching data from a database, running a calculation, saving new information, or returning an error. It acts as the coordinator between what the user wants and the systems that can deliver it.

Definition

A controller is a piece of code that receives a request, processes it, and sends back a response. When a user clicks a button or a system sends data to your application, a controller is typically the first thing that handles it. The controller decides what needs to happen — whether that means fetching data from a database, running a calculation, saving new information, or returning an error. It acts as the coordinator between what the user wants and the systems that can deliver it.

Why It Matters

Controllers are where business logic meets user interaction. They enforce the rules of your application — who can access what, what data gets saved, what validations run before an action is allowed. When controllers are well organised, your application is easier to maintain, test, and extend. When they become bloated with too many responsibilities, the application becomes harder to change without breaking something. For business owners, controller quality directly affects how quickly your development team can add features or fix issues.

Example

A client submits a support ticket through a portal. The request hits a controller, which first checks that the client is logged in and has permission to submit tickets. It then validates the form data — ensuring the subject is not empty and the message is within the allowed length. If everything passes, the controller saves the ticket to the database, sends a notification to the support team, and returns a confirmation page to the client. If validation fails, it sends the client back to the form with error messages.

Still Have Questions?

Our team is happy to explain technical concepts in plain terms. Get in touch.

Contact Us Browse Knowledge Center