---
layout: docs
title: codegenClassConstant
id: interface.Facebook.HackCodegen.ICodegenFactory.codegenClassConstant
docid: interface.Facebook.HackCodegen.ICodegenFactory.codegenClassConstant
permalink: /docs/reference/interface.Facebook.HackCodegen.ICodegenFactory.codegenClassConstant/
---
# Facebook\\HackCodegen\\ICodegenFactory::codegenClassConstant()




Create a class constant




``` Hack
public function codegenClassConstant(
  string $name,
): Facebook\HackCodegen\CodegenClassConstant;
```




## Parameters




+ ` string $name `




## Returns




* [` Facebook\HackCodegen\CodegenClassConstant `](<class.Facebook.HackCodegen.CodegenClassConstant.md>)