Skip to content

Instantly share code, notes, and snippets.

@akroii
Created October 9, 2021 11:50
Show Gist options
  • Save akroii/b803f8691d3919cfd3f1f5da0703714d to your computer and use it in GitHub Desktop.
Save akroii/b803f8691d3919cfd3f1f5da0703714d to your computer and use it in GitHub Desktop.
get cssclass from maeeventcategories
<?php
$categoriesModel = MaeEventCatModel::findAll();
$information = array();
$chunks = deserialize($this->categories);
foreach ($chunks as $chunk) {
if (array_key_exists($chunk, $information)) {
continue;
}
if ($categoriesModel) {
while ($categoriesModel->next()) {
if ($categoriesModel->id != $chunk) {
continue;
}
echo $information[$chunk] = $categoriesModel->cssClass;
}
$categoriesModel->reset();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment