php - How to access a public function from a model inside a controller in magento? -
\ magento issue. have controller called imagescontroller.php where
class my_sell_imagescontroller extends mage_core_controller_front_action
i extending/inhering core controller
now, have class
class my_advert_model_advert extends mage_core_model_abstract { public function isvalid($arrsteptpcheck){ ...
i access isvalid inside my_sell_imagescontroller maybe like
$advert = mage::registry('current_advert'); $arrerror = $this->isvalid(array('step1'));
but gives me
fatal error: call undefined method my_sell_imagescontroller::isvalid() in .....imagescontroller.php
i new magento backend. please help?
try code
mage::getmodel('advert/advert')->isvalid(array('step1'));
or
my_advert_model_advert::isvalid(array('step1'));
Comments
Post a Comment