adolfoalves Posted August 9, 2017 Share Posted August 9, 2017 Hello, help me ?I have a grid and would like to know how to get as information in .tpl my controllers/admin/AdminAlienTicketController.php public function renderView() { $tpl = $this->context->smarty->createTemplate(dirname(__FILE__). '/../../views/templates/admin/view.tpl'); $tpl->assign('alientickets', $this->loadObject()); return $tpl->fetch(); } When I click the View button, it displays the .tpl, but it does not load the items in the row that I clicked. my view.tpl <div class="form-group clearfix"> <label class="col-lg-3">{l s='RG:' mod='alienticket'}</label> <div class="col-lg-9">{$alientickets->rg}</div> </div> <div class="form-group clearfix"> <label class="col-lg-3">{l s='Email:' mod='alienticket'}</label> <div class="col-lg-9">{$alientickets->email}</div> </div> Link to comment Share on other sites More sharing options...
Scully Posted August 9, 2017 Share Posted August 9, 2017 (edited) From the code you posted we don't see how the object alientickets is loaded and if it is correctly loaded. Try to dump the object within HTML comments. echo "<!-- DUMPING OBJECT "; echo "<pre>"; var_dump($alientickets); echo "</pre>"; echo " -->"; After you load the modules pages, view the source code. I'd say the object is empty. Edited August 9, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 9, 2017 Share Posted August 9, 2017 And you can also check if your object is loaded like this: if (!Validate::isLoadedObject($myobject) { // throw some meaningful error message if not loaded } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now