Created
December 30, 2009 18:24
-
-
Save tjboudreaux/266265 to your computer and use it in GitHub Desktop.
This file contains 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
<!-- Wrapper for a slate --> | |
<div id="<?=$this->id ?>" class="<?=$this->slate ?> slate-wrapper"> | |
<?=$this->content?> | |
<div> | |
<!-- 3 Slate List View --> | |
<? if ($this->slate == Kfx2_View_Helper_ThreeSlate::SLATE_BLANK ) : ?> | |
<? elseif ($this->slate == Kfx2_View_Helper_ThreeSlate::SLATE_ERROR) :?> | |
<? elseif ($this->slate == Kfx2_View_Helper_ThreeSlate::SLATE_REGULAR) :?> | |
<? endif;?> | |
<!-- SET SLATE IN CONTROLLER --> | |
<?php | |
public function listAction() | |
{ | |
$materials = $this->_Material->getTable()->findAll(); | |
$this->view->slate = $materials->count() == 0 ? | |
Kfx2_View_Helper_ThreeSlate::SLATE_BLANK : Kfx2_View_Helper_ThreeSlate::SLATE_REGULAR; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this might have been better decided by using an action helper to route to a different view based on the state ... this is old and was only a concept.