Questions tagged [controller]

A controller is responsible for executing a sequence of instructions in response to some stimulus (maybe a command, action, or event). This is often used in conjunction with the Spring or model-view-controller tags.

A controller is responsible for executing a sequence of instructions in response to some stimulus (maybe a command, action, or event). It may be used to refer to the controller portion of the MVC (Model-View-Controller) pattern, or a general handler for actions and events that orchestrates a response. It may also refer to the Spring annotation @Controller.

As it can refer to a number of different things, this tag is best used in conjunction with other tags. So, if you're referring to the Spring @Controller annotation, use the Spring tag in conjunction with this one. If you're referring to the general MVC controller, use the model-view-controller tag.

16598 questions
3
votes
3 answers

AngularJS ng-controller undefined

I'm working on a small angular project, in which I make use of the bootstrap calendar by mattlewis92, and I keep having problem with my controller. Here is my .js file : 'use strict'; var app = angular.module('Calendrier574', ['ngMaterial',…
CamilleSNCF
  • 39
  • 1
  • 8
3
votes
3 answers

In Rails, any way to use app/helpers/foo.rb methods in Controller vs in View?

It seems that those helpers in app/helpers/foo.rb can be used in View, but cannot be used in Controller? In some cases, different controllers may need to use the same method but just pass in a different parameter, so in that case, won't it make…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
3
votes
2 answers

Ng-click don´t work

I have this controller. It´s for a map view on the app Im working on. For some reason the button I have on the footer is not working. The action on the function is never called... .controller('mapaCtrl', function($scope, $compile, $location) { …
3
votes
4 answers

MVC 4 return JSON as ActionResult

i'm trying to get my apicontroller to work. But somehow i cannot return Json(). Here's the error message from the compiler: Error CS0029 Cannot implicitly convert type 'System.Web.Http.Results.JsonResult<>' to 'System.Web.Mvc.JsonResult' …
NinjaOnSafari
  • 998
  • 1
  • 8
  • 32
3
votes
2 answers

How to pass Array of Objects from Angular Front-end to C# Back-end

I've generated an array of objects in Angular and I want it to send it to the C# controller. How can I do this? This is the code for generating the array of objects. var addObjectToArray = function (id, price, quantity, tax) { $scope.element = { …
Emi
  • 1,165
  • 4
  • 15
  • 26
3
votes
1 answer

cakephp foreach loop only display the first letter from title

i want to display data from database and also i have created function in model file which is showing data from database but all values are shown in the array format. problem is that when i print echo $values['title']; in foreach loop it is showing…
user2164884
3
votes
1 answer

Is it necessary to inject $scope to a controller in angularjs?

Is there any difference between the following two code snippet? Both work. 1. myApp.controller("myAppController", ["$scope", function($scope) { // function body }]); 2. myApp.controller("myAppController", function($scope) { // function body });
coolgod
  • 539
  • 6
  • 9
3
votes
1 answer

How do Wikipedia and other sites automatically transform what a user types in between certain tags into certain types of links?

I was just reading this Wikipedia page out of curiosity, and I was wondering if a programmer or web dev could explain to me how a certain function of it and other websites (including StackExchange ) work on the backend. If you want to link to an…
3
votes
2 answers

symfony2 recompile container from controller

I want to recompile container from controller when I use $this->container->compile(); public function changeAction(Request $request) { //...... echo($this->container->getParameter('mailer_user')."\n"); /*$cmd='php ../app/console…
ghaziksibi
  • 471
  • 3
  • 12
3
votes
1 answer

Search Query Laravel Input

I have a big search query and all works great but I need to show the Packages(seminars) for each user to this blade @foreach($users as $i=>$user) {{ $i+1 }} {{…
JP.dev
  • 170
  • 1
  • 18
3
votes
1 answer

Laravel : How to update data in one to one Eloquent relationship

I have two tables: 1. User. 2. Post. In post table i have saved the user information. So when I click on update, it should load the particular user data. It's get loaded but when i click on the save button to update save.It's showing the…
Hola
  • 2,163
  • 8
  • 39
  • 87
3
votes
1 answer

TypeError: can't convert Post into Array

I'm using Rails 3 and will_paginate. Pagination works fine in my Posts controller but in my Tags controller I get an error on the second Tag id. Here's the error: TypeError in TagsController#show can't convert Post into…
3
votes
1 answer

WebAPI - Return Response from Initialize (override) method

I have the same code on each API method: if (user.AspNetRoles.Where(p => p.Name == Models.Roles.SmartphonePhotographer).Count() == 0) { return Request.CreateResponse((HttpStatusCode)453, new { Message = "User does not…
Oleg Sh
  • 8,496
  • 17
  • 89
  • 159
3
votes
2 answers

How to get JSON data in an Odoo controller?

I am trying to send some JSON data to an Odoo controller, but when I send the request, I always get 404 as response. This is the code of my controller: import openerp.http as http import logging _logger = logging.getLogger(__name__) class…
forvas
  • 9,801
  • 7
  • 62
  • 158
3
votes
1 answer

Controller redirect to different paths depending on previous page

Question: How I want to redirect to different path after create action, given if previous_page is ../reader/new goes to ../reader/blog/:id, whereas if previous_page is ../editor/new goes to ../editor/blog/:id. Explaination: I want to modify the…
Safwan Marwan
  • 84
  • 1
  • 8
1 2 3
99
100