Skip to content

Instantly share code, notes, and snippets.

@tjboudreaux
Created December 30, 2009 18:24
Show Gist options
  • Save tjboudreaux/266265 to your computer and use it in GitHub Desktop.
Save tjboudreaux/266265 to your computer and use it in GitHub Desktop.
<!-- 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;
}
?>
@tjboudreaux
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment