How can I override or control whether "$this->items = $this->get('Items');" is added or not to the view.html.php #755
Unanswered
kreativejuices
asked this question in
Q&A
Replies: 1 comment
-
I would do this with some custom code in the Dynamic Get. But there are a number of ways to do this, none better or worse really. I think if you do a search here in the issues/discussions you will find some other treads that show examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I finally managed to get my first component working with JCB and I'm loving it. I've come across a scenario where I need to be able to control whether the line - $this->items = $this->get('Items'); is added or not in a front end site view.html.php. Something like this....
function display($tpl = null)
{
// get combined params of both component and menu
$this->app = JFactory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
$this->user = JFactory::getUser();
///////// I want to be able to add a condition around the $this->items = $this->get('Items') like so...
My understanding is that this is what calls the model thus makes the db call. I want to be able to control whether the call to the model is made or not. The db contains 10,000 rows and i dont want the call to happen if its no needed. I cannot see anywhere in JCB where i can do this without this file being overwritten each time i run the compiler.
Any help is much appreciated!
Thanks
Mr J
Beta Was this translation helpful? Give feedback.
All reactions