View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003411 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2011-12-01 12:26 | 2012-12-10 13:44 |
Reporter | wanis | Assigned To | |||
Priority | urgent | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 4.5.10 revision 44222 | ||||
Summary | 0003411: Use oxView::getTemplateName() getter in oxView::render() | ||||
Description | right now, if you write module or extend by other class function getTemplateName it is usefull only for /views/alist.php and /views/info.php . After this change, you could change template path by extending oxView::getTemplateName() | ||||
Additional Information | example of usage: we could write new parent view class for module which will add prefix where templates should be placed: class moduleview extends oxAdminView { public function getTemplateName() { return 'moduledir/' . $this->_sThisTemplate; } } ---------------------------------------- after this we can write simple controller only for displaying template: class sampleview extends moduleview { protected $_sThisTemplate ='sampleview.tpl'; } ---------------------------------------- and this will make test pass: class unit_admin_sampleviewTest extends OxidTestCase { public function testRender() { $oView = $this->getProxyClass('sampleview'); $this->assertEquals( 'moduledir/sampleview.tpl', $oView->render() ); } } --------------------------------- now you can easily change module template dir or even module name without changing each module view controller | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||