Eh,
It's a beginner's question but I really don't know what is the best way. I have a basic CRUD (Create, Retrieve, Update and Delete) in my project and I'd like to output some message if succeeded or not in a div inside the same page.
Yani, temelde, ben eylem aynı sayfa için ayarlanmış bir form var ve ben bir div #statusDiv I Register included with success gibi bir şey çıktı istiyorum bu aynı formda aşağıda var.
Bunu yapmak için en iyi yolu nedir?
- Denetleyici bir bayrak kümesi
$this->view->flagStatus = 'message'
ardından görünümünde diyoruz?
Sadece daha net yapmak için. Bu benim kod:
//IndexController.php indexAction()
...
//Check if there's submitted data
if ($this->getRequest()->isPost()) {
...
$registries->insert($data);
$this->view->flagStatus = 'message';
}
Sonra benim görünümü:
....
<?php if ($this->flagStatus) { ?>
<div id="divStatus" class="success span-5" style="display: none;">
<?php echo $this->flagStatus; ?>
</div>
<?php } ?>
....