summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorJens Klaer <kj.landwehr.software@gmail.com>2015-07-21 10:28:09 +0200
committerJens Klaer <kj.landwehr.software@gmail.com>2015-07-21 10:28:09 +0200
commit4ddfaee89b9a0f46bd7ff316e1cbd6157b396fd6 (patch)
tree9bda2bce4446de4911b779e72e6826243975f485 /framework/Web
parent0adeb70975cb1ecfcf2fe70576aedf33e0dc99bc (diff)
Fix setting class behavior properties
- allow setting class behavior properties for classes deriving from tcomponent only - properties need to be prefixed with 'set'
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/TTemplateManager.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 7e1b9c84..05c23fdc 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -938,7 +938,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
else
{
// a simple property
- if (! ($class->hasMethod('set'.$name) || $class->hasMethod('setjs'.$name) || $this->isClassBehaviorMethod($class,$name)) )
+ if (! ($class->hasMethod('set'.$name) || $class->hasMethod('setjs'.$name) || $this->isClassBehaviorMethod($class,'set'.$name)) )
{
if ($class->hasMethod('get'.$name) || $class->hasMethod('getjs'.$name))
throw new TConfigurationException('template_property_readonly',$type,$name);
@@ -973,7 +973,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
else
{
// id is still alowed for TComponent, even if id property doesn't exist
- if(strcasecmp($name,'id')!==0 && !$class->hasMethod('set'.$name))
+ if(strcasecmp($name,'id')!==0 && !($class->hasMethod('set'.$name) || $this->isClassBehaviorMethod($class,'set'.$name)))
{
if($class->hasMethod('get'.$name))
throw new TConfigurationException('template_property_readonly',$type,$name);
@@ -1086,7 +1086,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
if(!$class->isSubclassOf($name)) continue;
foreach($list as $param)
{
- if(method_exists($param->getBehavior(),'set'.$method))
+ if(method_exists($param->getBehavior(),$method))
return true;
}
}