> For the complete documentation index, see [llms.txt](https://reyvaleza.gitbook.io/vibe.d-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reyvaleza.gitbook.io/vibe.d-tutorial/the-employeecontroller-class.md).

# The EmployeeController class

The **EmployeeController** class will be the embodiment of the web framework. It will also be the controller for linking our views with the data (the model).

Edit **source\empcontrol.d**:

```d
module empcontrol;
import vibe.vibe;
import empmodel;

class EmployeeController
{
  private EmployeeModel empModel;
  private string realm = "The Lorem Ipsum Company";
  
  this()
  {
    empModel = new EmployeeModel;
  }
  
  void index()
  {
    render!"index.dt";
  }
  
  void getAddEmployee()
  {
    render!("empadd.dt", departments, provinces, paygrades);
  }
}
```

In D, the constructor is **this()** while the destructor is **\~this()**. In the constructor, we instantiated an **empModel** variable so we can start using the **EmployeeModel** class.

The method

`render!"index.dt";`

is a **variadic function template**. It means **render!()** can have a varying number of parameters (arguments) of different data types. We have seen this construct before with **staticTemplate!()**.&#x20;

In D, if there is only one parameter, the parentheses are optional.

In this case,

`render!("empadd.dt", departments, provinces, paygrades);`

**render!()** has three arguments (or parameters), one string and three arrays, so we have to enclose them in parentheses.

Sometimes when trying the app, instead of seeing a successful compilation, you might see several lines of errors instead. The usual culprit is the indentation. In that case, click on the ‘**Tab Size:**’ prompt at the bottom of VS Code for each file that cause an error:

<figure><img src="https://3936448450-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjGPCKHCWMHsDLNzX2hV8%2Fuploads%2FzKz3Q5lWLKcT1RKYGX9b%2Fimage54.png?alt=media&amp;token=2af4fa65-accc-4a7e-ad6c-47dc1b7c8465" alt=""><figcaption></figcaption></figure>

And choose to either convert all tabs to spaces or all spaces to tabs from the choices at the top of VS Code to make indentations uniform and consistent and make sure all indentation rules are followed, then save the file again.

<figure><img src="https://3936448450-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjGPCKHCWMHsDLNzX2hV8%2Fuploads%2F2GKfKmYKEQw4pyupFTT9%2Fimage55.png?alt=media&amp;token=369b941d-6e7b-4b61-9cfd-a7402bf71783" alt=""><figcaption></figcaption></figure>

We indicated that we are going to use an **EmployeeModel** class which we haven’t created yet, so let’s do that next.
