Web Interfaces of PROSUME

BlocksController.php 847B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Controller;
  3. class BlocksController extends AppController
  4. {
  5. public function index()
  6. {
  7. $this->loadComponent('Paginator');
  8. $blocks = $this->Paginator->paginate($this->Blocks->find()
  9. ->order(['timestamp' => 'DESC'])
  10. );
  11. $this->set(compact('blocks'));
  12. }
  13. public function wallet($wallet = null)
  14. {
  15. $this->loadComponent('Paginator');
  16. $blocks = $this->Paginator->paginate($this->Blocks->find()
  17. ->where(['Blocks.wallet_from =' => $wallet])
  18. );
  19. $this->set(compact('blocks'));
  20. }
  21. public function view($blocknumber = null)
  22. {
  23. $block = $this->Blocks->findByBlocknumber($blocknumber)->firstOrFail();
  24. $this->set(compact('block'));
  25. $this->set(['parametro'=>123]);
  26. }
  27. }