2017 © Pedro Peláez
 

silverstripe-module silverstripe-hasonecompositefield

Save has_one relationships directly from the parent record form

image

milkyway/silverstripe-hasonecompositefield

Save has_one relationships directly from the parent record form

  • Monday, December 9, 2013
  • by mi3ll
  • Repository
  • 1 Watchers
  • 8 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

HasOneCompositeField

This module allows you to add and edit a has_one directly from within the parent record form, made to look as if it is part of the parent record form., (*1)

I haven't tested it with GridField yet (haven't needed to). Would like to hear if it works, but I'm 40/60 sure it won't work as is., (*2)

Requirements

  • SilverStripe 3.1

Author

  • Mellisa Hankins [mell@milkywaymultimedia.com.au]

Install using composer

composer require milkyway/silverstripe-hasonecompositefield:*

Example Code

$relField = HasOneCompositeField::create('ContentBlock', 'Content Block', $this->ContentBlock(), $fields = null);

If no fields are defined, the field will try to find a getHasOneCMSFields method on the passed in record, otherwise it will fall back to getCMSFields., (*3)

Note: This will save the record if it does not exist yet when the form is saved. At the moment, there is no way to delete the record, but there are alernative modules which offer that solution if you need it., (*4)

The Versions

09/12 2013

dev-master

9999999-dev

Save has_one relationships directly from the parent record form

  Sources   Download

BSD-3-Clause

The Requires

 

by Mellisa Hankins

silverstripe relations has_one

09/12 2013

0.0.1

0.0.1.0

Save has_one relationships directly from the parent record form

  Sources   Download

BSD-3-Clause

The Requires

 

by Mellisa Hankins

silverstripe relations has_one