mvc

php+zend..pass parameter in request

hello, i want to pass parameter along with my add action.that is if owner in menu item is clicked then "is_owner" should by default get set otherwise reset..along with "add" want to send one more parameter and access it in view.this is request dispatcher.. $router->map('Company', 'Company', array('controller' => 'companies', 'action' =...

Can I pass arguments into a model function?

Is it even possible to do something like this in codeigniter?Is it considered a good practice in general? ...

Help with Codeigniter and MVC model pattern

I am creating a site much like a wordpress blog whereby the front page will display a post loop: with the post_summary, author info, and tags. I have four tables: posts | users | tags | tag relationships to display all the results i would need to do multiple JOINs for in the SELECT statement However, to stay with the MVC pattern, th...

how to change page content type at runtime in MVC?

hi, I am working in asp.net MVC & on the view has to show both json & xml content depending on some condition. I have to change the content type of the page at runtime ie, if the condition for json is fulfilled then set page contenttype = "text/json" & if the condition for xml is fulfilled then set page contenttype = "text/xml". ...

validations in MVC / MVP

I'm new to MVC / MVP and learning it by creating a Winform application. I have to some extent created the Models, Presenters and Views... Now where do my validations fit. I think the initial datatype validation (like only numbers in Age field), should be done by view. Whereas the other validations (like whether age is within 200) shoul...

Architecture: MVC based web-apps around a REST interface

I'm not sure how to phrase my question.... From different sources I pick up the idea that it makes sense to build web applications around a REST interface. A REST service could execute some controller logic (validations, database-access, etc) and then return a (static) *.xhtml resource. Combined with a decent javascript framework, thi...

ASP.Net MVC: How to redirect an uathenticated user from any page if they do not satisfy a condition

I need to redirect any Authenticated user to a specific page if they do not satisfy a condition. I have implemented a base controller from which all controllers inherit. In its OnActionExecuting override I plan to perform my test for the condition and redirect to the specific action if the condition is not met. Is this the most sens...

Use of Javascript in an MVC Application

I'm an assistant in a course where the students implement a web app (It's a Q&A site similar to stackoverflow) with the help of the Play! framework. This is a Java-based framework that relies on the MVC Pattern. The Model and Controller are written in Java where the view is written in HTML / CSS and some extensions that the framework pro...

MVC Master page and RenderPartial

I'm trying to create nested master pages in MVC. In the main master page I have a partial view that is rendered using Html.RenderPartial. This works fine when using the main master page directly in my view. The problem occurs when I have a child master page of the main master page. When using the child master page the RenderPartial metho...

Handling exceptions from a json request with ELMAH

Hi I am using ELMAH to handle expception in my MVC project. All is working fine, except for when the request is an ajax request. The exception is captured and logged but when I do a response.redirect to the error page, the redirect doesn't happen and the error message is displayed on the same page, overlapping the existing content. He...

How can I configure all the Catalyst actions in a given controller using Config::General?

I want to configure all the actions in my controller using my app's config file. According to Catalyst::Controller I can do this in the controller itself: __PACKAGE__->config( action => { '*' => { Chained => 'base', Args => 0 }, }, ); So I tried this in my config: <controller Foo> <action "*"> ...

MVC - Multiple Strong Type object ...inside one view

After so many years using ASP.Net, I’m still trying to figure out how to achieve the same results using MVC. I have a materpage with a control that is strongly type to something. When I navigate to a view of a different strongly type model ...and click on the button to execute something, I get "The model item passed into the dictionary...

MVC Model with Relational database

I am creating this MVC model and trying to understand best way to do it.How should I get related data when I have relationships between tables.For example in code below I have created a formviewmodel and I am calling function to get all images in Images table for a user. Should I instead keep images property of Users model and fill that ...

where is asp.net routing routedata stored? memory, disk, other?

Hi, I have several .NET MVC sites running in production and as the sites grow I have ever more and more routedata to store. I had expected that the routedata was somehow stored in memory but I have noticed that sites that I know have a lot of routes stored aren't taking up more memory. So, where is the mysterious routedata stored? I as...

Is this considered a model or a view object?

My application downloads images from the web and encloses them in custom Image objects. Using my Image class I can extract particular data from the images. That data is eventually presented to the user. With the model-view-controller paradigm in mind, can my Image class be considered a model class or a view class? ...

JQuery Watermark Plugin Submitting Watermarks As Values

I am using the jquery.watermark.min.js plugin. I just recently noticed that it is submitting the watermarks on form submit. It wasn't doing it before, but now it is. Not sure what I changed. Any ideas? Or fixes? I am using MVC, Ajax.BeginForm, I have a viewmodel with validation on it. The website said something about using jquery v...

IBAction/IBOutlet - Model View Controller

Hi All, In the MVC design pattern, which class file (appdelegate, viewcontroller etc) is best suited for these IBOutlet/IBAction scenarios?: IBAction (e.g. Show Menu) to be triggered by UIButton press event? IBOutlet to manipulate a UI elements properties (e.g. Hide Menu)? A poke around Apple's sample code seems to show IBOutlets ex...

Ajax.BeginForm, Calls Action, Returns JSON, How do I access JSON object in my OnSuccess JS Function?

Ajax.BeginForm, Calls Action, Returns JSON, How do I access JSON object in my OnComplete JS Function? so my ajax.beginform looks like this... using (Ajax.BeginForm("Coupon", new AjaxOptions { OnSuccess = "CouponSubmitted" })) and my OnSuccess Function Looks like this... function CouponSubmitted() { var data = response.ge...

mvc JQuery JSON.parse() to fill dropdown

I want to fill dropdown from the Javascript object returned from JSON.parse(). Tried but not successfull. Please help <script type="text/javascript" charset="utf-8"> <br /> //This is returned from Model. All I want to put that in dropdown.<br /> //var cat = JSON.parse('[{"Selected":false,"Text":"Blue","Value":"1"},{"Selected":f...

how to access paratmeter passed in request

how to access this paramvalue in controller..? $router->map('Company', 'Company', array( 'controller' => 'companies', 'action' => 'add', 'paramkey' => 'paramvalue', 'anotherparam' => 'anothervalue')); Plz help me ...