开发者

Better way to determine column class

I'm using the CSS layout framework "Adapt.js" (960.gs) for my website layout. It is a 3 column layout with two side columns of size x and wider center column with a width of 2x when both side columns are present 3x with one side column and full width (*4x) when no side columns are present. Different types of pages will be using left sided and right sided columns in different configurations.

Currently I decide my center column like this:

$both = ($hassidepre && $hassidepost);
$one  = ($hassidepre xor $hassidepost);
if($both)     $uwtheme['centergrid'] = "grid_6";
else if($one) $uwtheme['centergrid'] = "grid_9";
else          $uwtheme['centergrid'] = "grid_12";

I would love to learn a better way of determining the value of $uwtheme['centergrid'] since it feels clunky and I am sure there is some design pattern or common way of solving this 开发者_如何转开发that I haven't found yet.

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜