Database getRepository and BlockTypes
Permalink
I've got two menus hardcoded in my template:
However, they both output the same!
I dug into the code and saw the BlockType::getByHandle() using a getRepository function. That's probably caching the BlockType (including controller). Because the controller is then set, it will not instantiate a new one (which is normally done in "BlockType / loadController").
I haven't found a way to bypass this issue.
Any ideas?
Thanks, Adri
$bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'top'; $bt->render('main'); $bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'second'; $bt->render('second);
However, they both output the same!
I dug into the code and saw the BlockType::getByHandle() using a getRepository function. That's probably caching the BlockType (including controller). Because the controller is then set, it will not instantiate a new one (which is normally done in "BlockType / loadController").
I haven't found a way to bypass this issue.
Any ideas?
Thanks, Adri
http://www.concrete5.org/community/forums/5-7-discussion/hardcode-s...