In MVC architecture (Model-View-Controller), the object responsible for passing and receiving data to and from views, acting as a bridge between the "Model" and the "View".

learn more… | top users | synonyms

-1
votes
0answers
14 views

Extending Codigniter base controller work is working different than the documentation [closed]

As per the Codeigniter documentation it says to extend a base controller what we need to do are create a file named application/core/MY_Input.php, and declare your class with: ...
5
votes
2answers
92 views

Rails controller method that conditionally filters results

This code for my blog checks to see if tags are in the params hash. If they are, then only posts that are tagged will be paginated. Otherwise, all of the posts are paginated. ...
3
votes
1answer
121 views

Developing an alert notification in AngularJS

I'm studying Angular and want to develop my own notification alert. This is what I done, I like it and it's working like a charm but I think that it can be improved: Do I need to use it in ...
2
votes
1answer
87 views

Any improvements for my LoginController class?

This is probably going to be my final question regarding controllers. I feel like I have a good enough understanding of them now and am able to write them cleanly. I've recently adapted a less error ...
2
votes
1answer
35 views

Controller code using the koa framework

I would like to gather ideas on how to refactor the JavaScript/NodeJS controller code below to be more aesthetic. The code is using the koa framework thus I use ...
12
votes
2answers
358 views

My final sign up controller

I've asked a couple of questions here before regarding my controller, but I think I've finally gotten to understand controllers completely, but I'll never be sure unless I get my code reviewed. I've ...
4
votes
1answer
53 views

Is this approach correct when testing an Angular controller?

I'd like someone to review these tests to make sure I'm along the right lines in Angular testing. Note - They do all pass (great) but I feel like I'm struggling to understand the finer points of ...
3
votes
2answers
89 views

Controller: Sign up action clean up

I don't know if it's just me, but I feel like my sign up action method has gotten a bit messy. I think that perhaps instead of setting error messages in a controller, I should set error codes which I ...
8
votes
2answers
455 views

AngularJS Todo List - too much controller logic?

I am starting an angular app and I was wondering if I am on the right track with this. I worked on my last angular app when I was just a youngun who didn't understand the important of designing the ...
6
votes
1answer
95 views

Uploading file for related entity

I see that my code smells. The first file is a controller, and createAction. But I don't know where to delegate this. BookController.php - Whole controller class So this is most 'smelly' code to ...
2
votes
1answer
41 views

.ASP controller code

I've tried to create application with MVC N-layer pattern. I asked my buddy for a shot review, and he said, "You should separate logic from controller". But my controller only work as a ...
3
votes
2answers
73 views

Is it a classical MVC (Xerox Parc) implementation?

I've been trying to understand the original MVC implementation (the Xerox Parc's one). I'm sure it has flaws, but it's a simple code to practice/learn the original MVC. Working example View ...
1
vote
1answer
176 views

CodeIgniter maintain data through Controllers

I have a main menu in my application. It loads depending on the role of the user that I validate from a table in my data base, but I have to recreate this menu every time I call a new controller. ...
2
votes
0answers
94 views

What can I do better in this ViewModel Creator?

I'm currently creating a ASP.NET MVC page in C#. I want to hide everything regarding the creation of our "models" and "viewmodels". I have seen much of the fancy stuff regarding Dependency ...
0
votes
1answer
36 views

Is it reasonable to have separate controller actions for different user registration paths? Or should I refactor into a fewer number of actions?

I have two registration paths in my app. They are very similar and I am curious if I should simplify 4 associated actions down into two actions that handle the same amount of work. Here are my ...
2
votes
3answers
211 views

Controller with too many dependencies?

The main impetus for this review is to determine if my ASP.NET Web API controller has too many dependencies. I'm of the opinion that 3-4 is okay, but 6 seems like too many. I have many controllers ...
7
votes
2answers
3k views

Using a BaseController in MVC asp.net to reuse the repository

I have a repository class that impliments a repository Interface. In my Controllers I want a way to access the repository without creating constructors each time in the controller. So now all my ...
1
vote
1answer
191 views

Inserting using multiple contexts into LocalDB

I've written this ActionResult to model an Order that goes through. I couldn't think of another way to write this without using context ...
0
votes
2answers
147 views

Codeigniter - in the view or in the controller?

Is this correct? Or am I overloading the responsibilities of the view? ...
3
votes
2answers
2k views

Loading content in page via jQuery

I'm doing a web site in CodeIgniter and I'm loading the content page via jQuery, but I don't know if this is a good practice or not. Could I improve it? jQuery: // Another question here: how can I ...
0
votes
1answer
1k views

Doing $_POST the right way

I am not sure if I am correctly handling $_POST data in MVC pattern: Dummy $_POST data ...
2
votes
1answer
173 views

is this producer-consumer implementation correct?

I want to ensure that, as much as possible given my skill level, that I'm using relevant patterns correctly and following naming conventions. This is a controller for a poor-mans MUD client using ...
2
votes
2answers
101 views

Can I make this admin method in CakePHP more streamlined?

I have a VenuesController and an EventsController. My venues controller has an admin_add ...
10
votes
1answer
2k views

Generic ASP.NET MVC controller that generates many pages

I recently set out to create an open-source ASP.net MVC web development framework. Specifically, I wanted to automate some of the tasks associated with the creation of data-driven applications. I've ...
1
vote
1answer
93 views

Cleanup controller action

I would like some help to clean up this action, especially from @companies and downward. The comments should be enough to explain :) ...
1
vote
1answer
998 views

Router Class In a Lightweight MVC Boilerplate

I'm trying to come up with a simple router class. I considered using a Request class but that will rather make simple to complex. That is why I did not consider creating one for my framework. ...
1
vote
1answer
49 views

Linq to sql performance

I'm creating a system and I'm using EF with Linq. Model First. So I create my Model (.edmx) and using it, I generated my database and my classes. like the Usuario (user in portugues. going to keep ...
0
votes
2answers
184 views

How could I make my controller a little less hideous?

I have a controller. It functions as follows: A user imports a file and decides whether the files contents contain new entries to be placed into a database, or existing entries entries to be updated. ...
1
vote
1answer
92 views

Duplicate SQL code in controller

How I can rewrite or refactor my controller code? I have the same SQL query (@plan_gp_users) in all defs. ...
0
votes
1answer
210 views

Review: Finished router class for custom mini framework

I have finished my router and would like your thoughts on anything that may be inefficient of could be done better!: class Router { ...
7
votes
2answers
129 views

Action based controller using reflections

I'm modeling a reflection-based controller. I would like to know if you agree with my implementation and about what could be enhanced. I'm starting with reflection and I would like to know if I'm ...
4
votes
1answer
371 views

Code structure for a login modal dialog.

I'm using twitter mobile and I have a login-dialog. login-Dialog is a modal dialog. To call it the user calls loginDialog.show(); I'm not all that comfortable ...
4
votes
2answers
7k views

Search and filter in MVC3 Razor using Linq

This code works fine, but I just don't like all the if else. If I keep adding field to filter, it's going to get messy. I am not using EF and cannot on this. ...
4
votes
1answer
152 views

How to improve this design?

I have some design doubts regarding my controllers and I would like some advice... Everything works. However, I'd like to improve it. Basically I have one controller per screen(Swing). I have created ...
1
vote
2answers
84 views

How can I refactor this oversized Ruby method into smaller bits and have unit tests for them?

This is the existing code. Clearly way too much is going on in this index method and furthermore it's untested (and hard to test in its current form). ...
4
votes
2answers
342 views

PHP MVC controller code needs diet?

This is the dashboard controller code in PHP Symfony 2. It collects some aggregate data and points for charts, but i don't like it very much. Do you think that this code belongs to what a controller ...
1
vote
2answers
175 views

Rails - Loading data in controllers

I am refactoring my controllers, trying to improve the way common data is loaded for the actions. Initially I was using before_filter methods to do this but read ...
8
votes
4answers
3k views

How would you refactor this if statement of a Rails controller?

I first saw this gigantic if and tried to refactor it. Could only end with a endless switch statement. Old code - ...
3
votes
1answer
307 views

Need help with cleaning up this Controller

I've written the following controller and i was looking for some input/advice on how i could go about cleaning this up or rewriting it. I feel like i'm repeating myself a lot or that there might be a ...
2
votes
2answers
639 views

Controller for searching with certain parameters

In the index view a user can search with any combination of one to all of the following parameters: firstname, lastname or ...
4
votes
3answers
562 views

Not feeling 100% about my Controller design.

Basically, I'm uploading an excel file and parsing the information then displaying what was parsed in a view. ...