Title / Description
Code switch (count($modules)) { case 1: // 100% printf('<div class="grid-box width100 grid-h">%s</div>', $modules[0]); break; case 2: // 66% - 33% printf('<div class="grid-box width66 grid-h">%s</div>', $modules[0]); printf('<div class="grid-box width33 grid-h">%s</div>', $modules[1]); break; case 3: // 50% - 25% - 25% printf('<div class="grid-box width50 grid-h">%s</div>', $modules[0]); printf('<div class="grid-box width25 grid-h">%s</div>', $modules[1]); printf('<div class="grid-box width25 grid-h">%s</div>', $modules[2]); break; case 4: // 40% - 20% - 20% - 20% printf('<div class="grid-box width40 grid-h">%s</div>', $modules[0]); printf('<div class="grid-box width20 grid-h">%s</div>', $modules[1]); printf('<div class="grid-box width20 grid-h">%s</div>', $modules[2]); printf('<div class="grid-box width20 grid-h">%s</div>', $modules[3]); break; default: echo '<div class="grid-box width100 grid-h">Error: Only up to 4 modules are supported in this layout.</div>'; }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code