model-view-controller

PHP - MVC - Fetching the view

懵懂的女人 提交于 2020-01-23 10:42:25
问题 Greetings all! Looking for some help with MVC in a PHP context. Currently I am building a small, lightweight MVC framework to help expedite application development at work. It's a long hard separation eliminating inline code - at least with numerous projects looming overhead and the temptation to utilize it ever-present. I understand most of the basic requirements of MVC, and I've already begun porting some of my existing classes that are in Singleton pattern over as utilities in my new

Laravel 5 multiple optional parameters in route

浪尽此生 提交于 2020-01-23 08:37:50
问题 I have a problem with Laravel 5, and to be precise, I can't find the solution for it. In C# (ASP.NET MVC) it's easy to solve. For example, I have these routes (I'll just type the route content, and the function header, for the sake of simplicity) /{category}/Page{page} /Page{page} /{category} The function is defined inside Product controller. function header looks like this: public function list($page = 1, $category = null) the problem is, whenever I enter just one argument, it doesn't send

Demandware MVC concept

大憨熊 提交于 2020-01-23 05:50:05
问题 I am new guy to Demandware and I am switching from Magento to Demandware. Demandware is not opensource I am not getting proper tutorials, stuff to understand the concepts of it. I am from Magento so I know the Magento MVC structure. But in Demandware we have different concepts like pipelines, pipelets, ISML scripts, ECMA script, DW scripts etc. I want to know the MVC pattern of Demandware. How it works and what are the basic concept I need to concentrate? 回答1: I would suggest to request a

Winforms MVP Grid Events Problem

倖福魔咒の 提交于 2020-01-23 03:11:26
问题 I am trying to implement the MVP pattern for WINFORMS. Its a simple for with a button and a Grid, on button click, the grid will load, and user can fill in values into the grid. For my button click event, I have something like this: _presenter.LoadGrid(); Which is simple and straightforward. My question is, in regards to grid... I am planning to have a row click event firing....for enabling/disabling the subsequent input fields for the specific columns/rows of the grid etc. I understand that

In MVC where do you put references to your model Classes?

…衆ロ難τιáo~ 提交于 2020-01-22 07:11:52
问题 I have been wondering for a while, after asking different people and without any of them providing what I would call an "at least a bit concrete answer": Question: Where, in an iPhone application should an application keep the references to it's Model Classes (using the MVC approach) ? In iPhone (and Cocoa) applications we have what we call the "App Delegate", which basically start's up our application and inits our controllers, also handles UITouch events. So is the App Delegate a controller

how to build a good router for php mvc

放肆的年华 提交于 2020-01-22 06:01:45
问题 I'm experimenting with php mvc and I'm stucked with the following issue. My request and router classes are really simple and I would like to extend theme to can handle controller calls from sub folders and to controller classes functions should be able to pick up url variables send it threw get and post. my router looks as it follows class Router{ public static function route(Request $request){ $controller = $request->getController().'Controller'; $method = $request->getMethod(); $args =

how to build a good router for php mvc

感情迁移 提交于 2020-01-22 06:01:12
问题 I'm experimenting with php mvc and I'm stucked with the following issue. My request and router classes are really simple and I would like to extend theme to can handle controller calls from sub folders and to controller classes functions should be able to pick up url variables send it threw get and post. my router looks as it follows class Router{ public static function route(Request $request){ $controller = $request->getController().'Controller'; $method = $request->getMethod(); $args =

PHP - The best way to load Database object from Model, but to have only one instance?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-22 05:31:43
问题 This is my problem, I have a tiny PHP MVC framework i built. Now when Im in Controller, i should be able to load a Model. I have Models named like database tables like Users.php, Pages.php etc. All Controllers extend BaseController, and all Models extend BaseModel, this way I can have some methods available to all Controllers. Like from any Controller I can use loadModel method like this: $usersModel = $this->loadModel("Users"); Now $usersModel will be object that represents users database

I am getting an extra empty {} json object along with a && before my output from a simple spring mvc json service

坚强是说给别人听的谎言 提交于 2020-01-21 12:14:11
问题 OK, I have a spring mvc based json web service. This is a test app, I have never seen a problem like this when building spring mvc based restful json services. The output of my test service always returns and empty json object followed by && followed by the data i want to return. So the result looks like this: {} && {"status":200,"serverTime":"January 6, 2013 7:35:45 PM EST"} The code for my controller method to process this very simple GET request is: @RequestMapping(value = "/test.json",

Can not connect JAX-RS service to MVC template

こ雲淡風輕ζ 提交于 2020-01-21 03:29:05
问题 I'm attempting to make use of JAX-RS' (Jersey) MVC pattern. Attempts to reach http://localhost:8080/myproject/foos/test result in an error that reads: java.io.IOException: The template name, /view, could not be resolved to a fully qualified template name http://localhost:8080/myproject/foos results in the same error. What am I missing? Resource: package resources; import com.sun.jersey.api.view.Viewable; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import