Skip to content

Instantly share code, notes, and snippets.

@nsams
Created May 19, 2015 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsams/75296553965ac65d40f2 to your computer and use it in GitHub Desktop.
Save nsams/75296553965ac65d40f2 to your computer and use it in GitHub Desktop.
Component with settings
<?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;
}
}
<?php
class Foo_Controller extends Kwf_Controller_Action_Auto_Kwc_Form
{
}
<?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