CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Is it possible MVC Using PHP?

Print topic Send  topic

Author Message
vikrant


Posts: 32
Posted: 05/10/2014, 2:40 AM

Hi,

Using codecharge - php, how to achive MVC pattern programming?


_________________
Vikrant
View profile  Send private message
eratech


Posts: 513
Posted: 05/10/2014, 11:08 PM

CCS doesn't do MVC, really, but why do you need MVC? What benefits of MVC are you looking for?

Eric

_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
spaul8808

Posts:
Posted: 05/30/2014, 4:43 AM

Yes, We can use MVC(Model View Controller) model in PHP.
It is possible to write a web application in PHP whose architecture is based on the MVC pattern. Let’s start with a bare bones example:

<?php
class Model
{
public $string;

public function __construct(){
$this->string = "MVC + PHP = Awesome!";
}
}

<?php
class View
{
private $model;
private $controller;

public function __construct($controller,$model) {
$this->controller = $controller;
$this->model = $model;
}

public function output(){
return "<p>" . $this->model->string . "</p>";
}
}


<?php
class Controller
{
private $model;

public function __construct($model) {
$this->model = $model;
}
}

We have our project started with some very basic classes for each part of the pattern. Now we need to set up the relationships between them:

<?php
$model = new Model();
$controller = new Controller($model);
$view = new View($controller, $model);
echo $view->output();
------------------------------------
Reference:- http://www.logicspice.co.uk/php-programming-services
View profile  Send private message
eratech


Posts: 513
Posted: 05/31/2014, 2:08 AM

spaul8808

I know you can do MVC in PHP, but you don't in Codecharge, and you would lose the benefits of the quick development that CodeCharge offers.

I use CCS because I can get the job done fast without needing to dig through code all the time - that's the benefit it gives me that outweighs the benefits that MVC might give me.

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.