php - Redirect to a homepage cakephp 3 -


i've followed articles tutorial cakephp 3 website , created website

http://i.imgur.com/jmh1pwv.png

now there add article, delete article , edit article actions.

when delete article redirect me

http://localhost:8888/test/articles/delete/14

here delete code.

public function delete($id) {         $this->request->allowmethod(['post', 'delete']);          $article = $this->articles->get($id);         if ($this->articles->delete($article)) {             $this->flash->success(__('the article id: {0} has been deleted.', h($id)));                 return $this->redirect(['action' => 'index']);         }     } 

the same happening add , edit.

now stays on blank page(http://i.imgur.com/tdcbxzz.png). return $this->redirect(['action' => 'index']); line suppose redirect homepage i.e on index

in routes.php i've defined route

 router::connect('/', array('controller' => 'articles', 'action' => 'index')); 

my question is, how can redirect homepage. followed tutorial on website.

looks "license header" line supposed comment, not within <?php ?> tags , hence being taken output. if that's case, fact output has been generated stop redirect happening.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -