Created
May 19, 2015 08:00
-
-
Save nsams/75296553965ac65d40f2 to your computer and use it in GitHub Desktop.
Component with settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo_Component extends Kwc_Abstract | |
{ | |
public static function getSettings() | |
{ | |
$ret = parent::getSettings(); | |
$ret['componentName'] = trlKwfStatic('Foo'); | |
$ret['ownModel'] = 'Kwf_Component_FieldModel'; | |
$ret['extConfig'] = 'Kwf_Component_Abstract_ExtConfig_Form'; | |
return $ret; | |
} | |
public function getTemplateVars() | |
{ | |
$ret = parent::getTemplateVars(); | |
$ret['foo'] = $this->_getRow()->foo; | |
return $ret; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo_Controller extends Kwf_Controller_Action_Auto_Kwc_Form | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo_Form extends Kwc_Abstract_Form | |
{ | |
protected function _initFields() | |
{ | |
parent::_initFields(); | |
$this->fields->add(new Kwf_Form_Field_TextField('foo')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment