View more context

 

sutherlandesign

looks like i got it, it shows "<input type="hidden" name="ID" value="53" class="hidden" id="Form_ClassEditForm_ID" />"

Shaun Cockerill

Hi guys, does extraStatics still work in SS4? I don't want to use $db in my extension as it's dynamically generated, but if I try to output something within extraStatics and exit it doesn't show.

sutherlandesign

it was this code: HiddenField::create('ID')->setValue($id); The ids on other way around

sutherlandesign

but still getting error "[Notice] Undefined variable: id" for this bit "$class = ClassListings::get()->filter(array('ID' => $id));"

CptPillow

put that inside a if statement if($data['ID']){ $class= ClassListings::get()}else{$class = ClassListings::create()}

sutherlandesign

That look right?

Files: Requires logging in with Slack to view/download
Untitled
CptPillow
Files: Requires logging in with Slack to view/download
Untitled