---
layout: docs
title: addElseIfBlock
id: class.Facebook.HackCodegen.HackBuilder.addElseIfBlock
docid: class.Facebook.HackCodegen.HackBuilder.addElseIfBlock
permalink: /docs/reference/class.Facebook.HackCodegen.HackBuilder.addElseIfBlock/
---
# Facebook\\HackCodegen\\HackBuilder::addElseIfBlock()




End current if/else block, and start a 'else if (condition)' block




``` Hack
public function addElseIfBlock(
  string $condition,
): this;
```




## Parameters




- ` string $condition `




## Returns




+ ` this `