Ejemplo n.º 1
0
 /**
  * @secured
  */
 public function handleRegenerate($tagId)
 {
     try {
         $tag = $this->tags->findOneBy(['id' => $tagId]);
         $tag->color = substr(md5(rand()), 0, 6);
         //Short and sweet
         $this->tags->save($tag);
         $this->flashMessage('Tag byl úspěšně regenerován.', 'success');
     } catch (\Exception $exc) {
         $this->flashMessage($exc->getMessage(), 'danger');
     }
     $this->redirect('this');
 }