Jump to content

Albert

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Albert

  1. That was it! Thank you so much! So first save the empty new item AND THEN populate it! BIG THANKS!
  2. But I cannot just make a new repeaterfield? If so then I have to go with pages instead...
  3. Hy, I cannot get it going. I try to update a repeater field, containing username, email, a int value, a addresse and a description. I post the data to a handlerfile. So far so good. But how can I save the data to the field? The Pages is under home and contains a repeater_field named multi_locations -> this should be updated. My try so far: if ($input->post) { // $p = new Page(); // $p->of(false); // $p->parent = $pages->get(1); // $p->template = $pages->get('probleme'); var_dump($p); $melder = $sanitizer->text($input->post->melder); $email = $sanitizer->email($input->post->email); $location = $sanitizer->text($input->post->location); $urgency = $sanitizer->selectorValue($input->post->inlineRadioOptions); $description = $sanitizer->text($input->post->description); echo $melder . "| " . $email . "| " . $location . "| " . $urgency . "| " . $description; $p->multi_locations->title = "tryout"; $p->multi_locations->melder = $melder; $p->multi_locations->mailadresse = $email; $p->multi_locations->map->address = $location; $p->multi_locations->urgency = $urgency; $p->multi_locations->beschreibung = $description; //$p->save(); Please help me bring some light into the dark. Thank you in advance!
  4. code should be: elseif($field->type instanceof FieldtypeMapMarker) { $value = trim($value); //$page->set($name->address, $value); $page->$field->$name = $value; }
  5. okay thank you, that gives a great overview. But if wire() is global, why does it throw an error inside the function?
  6. So I gave it a try now. I am a bit confused on this wire concept: $validEmail = $wire->users->count("email=$em") == 0 ? true : false; // result is NULL on valid and not valid Emails if I try to wire inside a function I get a call to member function error?? function checkMail($em) { if($wire->users->count("email=$em") === 0) { $validMail = 1; } else { $validMail = 0; } return $validMail; }
  7. Thank you for your detailed answer, I will try right away!
  8. Somehow now it works....but I don't really know why....can you help me? if($input->post->email){ $em = $sanitizer->email($input->post->email); var_dump($validMail, $checkMail->count, $em); echo "<br>--------------<br>"; $checkMail = $wire->pages->find("template=user, email=$em"); var_dump($checkMail); echo "<br>--------------<br>"; if($checkMail->count == 0){ $validMail = 1; } else { $validMail = 0; } }
  9. Hello @ all, I am trying to check a users input on the register process: if($input->post->email){ $em = $sanitizer->email($input->post->email); var_dump($validMail, $checkMail->count, $em); echo "<br>--------------<br>"; $checkMail = $wire->pages->find("template=user, email=$em"); if($checkMail->count !== 0){ $validMail = 0; } else { $validMail = 1; } } int(1) int(0) and some mailstring is returned in the var_dump below this code, as the mail address is in the DB, it should return int(0) int (1) for valid email = 0; Can anyone assist me please? Thank you in advance!
×
×
  • Create New...