Wenn ich das DCA als Tabelle anlegen bekomme ich so aber die Werte von den Feldern.
Meine momentane Config:
PHP-Code:
'config' => array
(
'closed' => true,
'onsubmit_callback' => array(array('Branding_class', 'myOnsubmitCallback')),
'dataContainer' => 'Table'
),
PHP-Code:
class Branding_class
{
/**
* onsubmit_callback: Wird beim Abschicken eines Backend-Formulars ausgeführt.
* @param $dc
*/
public function myOnsubmitCallback($dc){
$string="/* Brand Colors Primary */
--spotcolor1: #". $dc->activeRecord->spotcolor1.";
--spotcolor2: #". $dc->activeRecord->spotcolor2.";
/* Greytones */
--black: #".$dc->activeRecord->black.";
--midgrey: #".$dc->activeRecord->midgrey.";
--lightgrey: #".$dc->activeRecord->lightgrey.";
--white: #". $dc->activeRecord->white.";
--bodybackground: #".$dc->activeRecord->bodybackground.";
/* UI Colors */
--error: #".$dc->activeRecord->error.";
--success: #".$dc->activeRecord->success.";
--info: #".$dc->activeRecord->info.";
--signal: #".$dc->activeRecord->signal.";
--warning: #".$dc->activeRecord->warning.";
--inactive: #". $dc->activeRecord->inactive.";
";
file_put_contents("path",$string);
}
Es enthält die korrekten Werte.
Aber für File muss ich etwas anders machen, da dort activeRecord tatsächlich nicht existiert.
Lesezeichen