PHPackages                             codelight/acf-blocks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codelight/acf-blocks

ActivePackage[Utility &amp; Helpers](/categories/utility)

codelight/acf-blocks
====================

2.1.2(2y ago)414.0k1[7 issues](https://github.com/codelight-eu/acf-blocks/issues)PHPPHP &gt;=7.0.0

Since Jun 12Pushed 2y ago7 watchersCompare

[ Source](https://github.com/codelight-eu/acf-blocks)[ Packagist](https://packagist.org/packages/codelight/acf-blocks)[ RSS](/packages/codelight-acf-blocks/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (12)Used By (0)

ACF Blocks
==========

[](#acf-blocks)

ACF Blocks is a lightweight library that provides a clean, object-oriented API to create and render ACF field groups.

Your WordPress code base doesn't have to be a mess.

**This library is in beta. Use at your own risk. Contributions are welcome.**

Overview
--------

[](#overview)

ACF Blocks introduces the concept of *blocks*, which are essentially Controllers (or actually ViewModels) for field groups and flexible layouts. Fields are created using the excellent [ACF Builder](https://github.com/StoutLogic/acf-builder) library.

The three main benefits of using ACF blocks are:

- Speed up development of simple sites,
- Provide a super simple, but clean architecture for developing more complex sites,
- Allow re-using blocks between projects.

Installation
------------

[](#installation)

```
composer require codelight/acf-blocks dev-master

```

If you're still not using Composer in 2018, then do yourself a **huge** favor and get started now. \[todo: article\]

Example 1: Quick procedural blocks
----------------------------------

[](#example-1-quick-procedural-blocks)

As an example, let's go through creating and rendering a simple field group.

```
