コード例 #1
0
 public function update()
 {
     if (isset($_POST["id"])) {
         $id = (int) $_POST["id"];
         $name = $_POST["name"];
         $description = $_POST["description"];
         //If the words contains the description are not as tag, create it, switch pattern.
         $words = explode(" ", $description);
         $notags = array("a", "ante", "bajo", "cabe", "con", "contra", "de", "desde", "durante", "en", "entre", "hasta", "hacia", "mediante", "para", "por", "segundo", "sin", "sobre", "tras");
         $tags = array_diff($words, $notags);
         $entrada = new Entrada();
         $entrada->checktags($tags, $id);
         $entrada->updateReg($id, 'NAME', $name);
         $entrada->updateReg($id, 'DESCRIPTION', $description);
     }
     $this->redirect("Entradas", "index");
 }