Can't set custom date attribute
Permalink 1 user found helpful
I'm trying to set up a start date and end date range. The start date gets set just fine, but I can't seem to get the end date value.
This is my saveData function in my controller:
And here's my code on the form that gets submitted:
Any idea what I should be doing differently?
This is my saveData function in my controller:
private function saveData($p) { $blocks = $p->getBlocks('Main'); foreach($blocks as $b) { $b->deleteBlock(); } $bt = BlockType::getByHandle('content'); $data = array('content' => $this->post('eventsBody')); $p->addBlock($bt, 'Main', $data); Loader::model("attribute/categories/collection"); $cak2 = CollectionAttributeKey::getByHandle('events_thumbnail'); $cak2->saveAttributeForm($p); $cak3 = CollectionAttributeKey::getByHandle('events_main_image'); $cak3->saveAttributeForm($p); $cak4 = CollectionAttributeKey::getByHandle('prov'); $cak4->saveAttributeForm($p);
Viewing 15 lines of 32 lines. View entire code block.
And here's my code on the form that gets submitted:
Any idea what I should be doing differently?
in the saveData function sets that attribute, but I can't seem to get the values sent from the form.
Edit:
This seemed to work for me. Hope it helps someone.