controller

OpenCart pass variable to twig from controller

折月煮酒 提交于 2019-12-11 18:14:07
问题 Hy! I need to use some data in twig files, how do I pass it from header.php to twig files? I created a new element in $data array, but It doesn't exist in the twig files. $data['testvar'] = "test string"; And I try to access it in twig files like this: {{ testvar }} 回答1: After you made some changes, you must in admin dashboard refresh your modifications and clear cache, blue gear icon in right upper corner. 回答2: If you add $data['testvar'] = "test string"; only in catalog/controller/common

parse json data in angular controller

和自甴很熟 提交于 2019-12-11 18:08:25
问题 I get this json data by $http.get and did the assigning like this $scope.a = data.a ,how to access x? when I print a in console it shows [object Object],[object Object] , shouldn't it be [object Object Object],[object Object Object] ? And when I use $scope.a[0].x[0] , it says undefined. Any idea how to solve it? { "a": [{ "x":1385118661279, "y":{ "y1":25, "y2":"12" }, "z":[ { "z1":20 }, { "z2":23 } ] }, { "x":1385118650279, "y":{ "y1":25, "y2":"32" }, "z":[ { "z1":21 }, { "z2":22 } ] }], "b":

timeout on waiting for command from linear stage device using matlab

人盡茶涼 提交于 2019-12-11 17:18:07
问题 I am trying to establish a full duplex serial communication between the RS485 port of a stepper motor controller and the COM port of my laptop. The cable I use connects to RS485 on the controller and to a USB port on my laptop. I am using a Matlab script to send and receive commands to the controller to move a stage block on a guided linear scale. While I can open the serial connection to the device and send commands to advance the stage block on the linear scale, I am unable to receive any

Rails - Editing User and Profile Models from separate Settings Controller

浪尽此生 提交于 2019-12-11 17:04:44
问题 I'm struggling to figure out exactly how to get this to work, but essentially I have 2 models: class User class Profile One User has One Profile. I also have a SettingsController with "profile" and "update" actions: class SettingsController < ApplicationController def profile @profile = User.find_by_id(current_user).profile end def update set_profile respond_to do |format| if @profile.update(profile_params) format.html { redirect_to @profile, notice: 'Profile was successfully updated.' } else

Realex payment, response cant be Handled .Net

微笑、不失礼 提交于 2019-12-11 17:02:10
问题 i trying to implement a hpp full redirect to realex payment, i have 2 controllers one that send the request to the realex payment server and the second to which the response is sent back. i get the response in json as such {"RESULT":"00","AUTHCODE":"12345","MESSAGE":"[ test system ] AUTHORISED","PASREF":"15441812060166886","AVSPOSTCODERESULT":"M","AVSADDRESSRESULT":"M","CVNRESULT":"M","ACCOUNT":"internet","MERCHANT_ID":"MyID","ORDER_ID":"UYCRWpJtlE-B1n62SE7EKg","TIMESTAMP":"20181207111253",

Laravel index route issue when using for a subsection in another fw (external public dir)

点点圈 提交于 2019-12-11 16:56:06
问题 I'm using a Laravel app with an external public directory, e.g. root/Laravel , and root/html/public . I need this app to load from a require on a php file ( root/html/this-section.php ) that already has another framework loading it, hence that other fw has its own head, and body tag. This app will load between the header and footer of that file. When I set up the routes, i notice that both of the following routes work, but i get different results. Route::get('/', 'HomeController@index');

Use breadcrumbs with tree dynamically SAPUI

可紊 提交于 2019-12-11 16:55:51
问题 I am trying to extend the tree basic sample and adding breadcrumbs depending on the tree level. This is my xml: <mvc:View controllerName="sap.m.sample.Tree.Page" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"> <Breadcrumbs id="bread" currentLocationText="Start"> <Link text="{/lItem}"/> </Breadcrumbs> <Tree id="Tree" items="{path: '/'}" toggleOpenState="onToggle"> <StandardTreeItem id="item" title="{text}"/> </Tree> And here is my controller: sap.ui.define(['sap/ui/core/mvc/Controller', 'sap/ui

How to call controller's method

拟墨画扇 提交于 2019-12-11 16:51:33
问题 I have a functionality that doesn't relate to incoming requests (like get,post,etc). But I want to follow MVC convention and make it like Model-Controller: in controller part I will process income requests from another parts, decide from which model it should retrieve information, authorization, filtering and so on; in model part I will store information, validate it, expire it and etc. In Rails the controller's actions can be called by income request directed by routes file. The problem for

Query to retrieve the latest entry in a history table in Laravel 5.2

你。 提交于 2019-12-11 16:02:49
问题 Here is the table table: StudentHistory id | date | name | grade | subject ---- | ------ |------ |--------|------ 1 | 5/1/2017 |Mark | a | science 2 | 7/1/2016 |Earl | c | english 3 | 2/1/2015 |John | a | english 4 | 6/1/2016 |Mike | c | science 5 | 4/1/2016 |Matt | e | english 6 | 2/1/2017 |Mark | d | science 7 | 3/1/2016 |Earl | a | english 8 | 7/1/2015 |John | d | english 9 | 8/1/2016 |Mike | c | science What I want to happen is to populate the latest grades ONLY in English for students

JavaFX FXMLLoader InvocationTargetException?

亡梦爱人 提交于 2019-12-11 15:48:28
问题 I am trying to update some components situated in other Controller using FXMLLoader, When i run my code i get this exception : Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86