Last active
August 29, 2015 14:03
-
-
Save markhalliwell/81bf32250d69e6e716c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $items = array(); | |
| $build['list'] = array( | |
| '#theme' => 'item_list', | |
| '#items' => $items, | |
| '#empty' => t('You have no content, please <a href="!link">create some</a>.', array( | |
| '!link' => 'node/add', | |
| ), | |
| ); | |
| // vs | |
| if (count($items)) { | |
| $build['list'] = array( | |
| '#theme' => 'item_list', | |
| '#items' => $items, | |
| ); | |
| } | |
| else { | |
| $build['list'] = array( | |
| '#theme' => 'container', | |
| 0 => array( | |
| '#markup' => t('You have no content, please <a href="!link">create some</a>.', array( | |
| '!link' => 'node/add', | |
| ), | |
| ), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment