MVC architecture for front-end [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am writing application in PHP (+ MySQL database), but it gonna be mainly AJAX aplication. So, I am wondering, how to create frontend? Frontend also in MVC? Is it possible?

Of course MVC is possible on the front end also. JavaScript is a rich programming language, and since MVC is only a design architecture it's language agnostic. There are some attempts at MVC in some JS frameworks, mainly sproutcore and JavaScriptMVC.
I guess there are two paths to go, either separate PHP and frontend completely, and just pass JSON or XML with ajax between them, or blend them like a classic web application, and do some ajax-requests on top of that.

Unfortunately it is still not a good idea to rely on JavaScript being enabled, so having JavaScript applications "fail" gracefully is preferred.
I would recommend creating a basic PHP/HTML click-and-reload application first, which would allow dinosaurs to use the basic features of the site, and then build a JavaScript/AJAX application on top of that, which would enhance the base application.
As to the MVC question: It is definitively possible to create a JavaScript MVC front-end. I tried it myself a few months ago and it worked great. Just keep a close eye on the scope of your function calls. They can get away from you if you aren't careful :-P

You can use AngularJS if you want (AngularJS is an MVC framework for JavaScript).

Related

What is the way to develop modern php based large scalable web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to build a web-application using the php, I have started with CodeIgniter and Smarty. The issue is I came to know opinion about this combination like "framework in 2015?, like a joke", there are so many framework and all the updated and and many more thing like socket and node.js and all which make me so confusing.
I know many thing have there own need and work all the way, but I want to develop a site which will expecting 1-5 million hit monthly and I want it fast and efficient, using core php need to do more work which a good framework can do for you but still not sure what's the best approach to go from here.
Any top PHP framework like Laravel or Symfony can handle websites with so much traffic. If you want to create an API based on PHP and leave front-end to another app like Angular, you may also take a look a Lumen or Slim Framework.
I know it's a broad question but answer is simple, these frameworks give you the tools, as long as you follow modern principles and use caching they will be able to serve that many requests.

How to make web applications look exactly like desktop applications? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I was wondering if there is a definitive solution for building web applications that looks like desktop applications, for corporative users that are used to windows. I MEAN THE GUI DESKTOP PERSPECTIVE.
Can anyone help me with that? I use PHP.
I am in a group developing an application that will work for a bank, and that must look exactly like an application so the users do not even notice it is a web based one for security reasons (informed by the bank holder).
We have tried to use Java Applet, but it took just too much time to load, as the application is very big.
you can use ExtJs for your front end and php as back-end.ExtJs is a javascript framework for web-application.
http://www.sencha.com/products/extjs/
I can't recommend PHP for anything personally, so here are some others...
Silverlight is a pretty good start. Does that even count as a web app?
http://en.wikipedia.org/wiki/Microsoft_Silverlight
SharePoint is a better alternative, being a Microsoft product.
http://en.wikipedia.org/wiki/Microsoft_SharePoint
On a subjective note, the internet is so pervasive now that just writing a friendly web page should be enough. Everyone uses the internet and can usually figure things out that present the format nicely.
What data will your application be serving? That has a big part in what framework you pick.

Startup building and mokup [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
since about two years ago, I did find my interest in code (Hardware/Sytems/Web) and now, I've found a project which motivates me a lot (It takes all my free time indeed).
Starting this point and because my project could soon switch from a free time project to a daily job, I'm currently developing a mockup of this project based on PHP/MySQL and JQuery.
Even if I'm a true Python/MongoDB lover and a System Engineer, I did prefer those technologies to build up my mockup because of their simplicity to build a complete functional private stack at home.
I'm pretty advanced on my mockup and it seems to work as I want it.
Now I'm wondering if, about your point of view, would have been better to start to build my mockup using directly the targeted technologies (Python/MongoDB) rather than to use the easy PHP/MySQL couple to do it?
Obviously, because I plan to made this project my daily job, I had to have something visually functionnal to be able to raise a little bit of money, and about me, using an easier stack it's more easy, but I would like to have your feedback on this kind of question.
The idea that PHP/MySQL is easier or simpler than say Python/MongoDB is just inconsistent.
If you compare for example, Django (the most popular python web framework) with symfony(PHP) you will find that they are almost identical in terms of features and architecture (symfony is actually slightly more complex but also has more very advanced features).
For mockups, if I were you, I would use solely HTML/jQuery/CSS.
Build your pages just like you would like to have them in your beta version, use jQuery to load sample data written in json.
That's all you need. You can even find WYSIWYG application to speed up the process.
Later on, you can build the back-end application using either python or php, it won't matter.
The integration process will be identical, create your models, create the controllers, and use the HTML you already have as templates.
Building your app in php/mysql then convert it to python/mangodb will make you rewrite almost all the code simply because python is so much different from php (easier I would say too, but that's just my opinion) and because mangodb is not a relational database meaning you will have also to rethink partially your architecture.

Things to consider when creating a web framework [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am not trying to create yet another web framework.
For one of the applications I am working on, I want to create a custom framework. I don't want to use any already available framework.
What are the common things to consider?
What should be the architecture?
Thanks :)
If the point of a framework is to make tedious things easy, a good start would be to consider what is tedious.
What are the common things to consider?
Purpose. Usually, when you start building a piece of software, you have a purpose in mind. What will it do that other programs can't?
If you can't answer that question, then take any existing open source framework, change its name and your job is done. Now you have your own framework.
Well if you are going to write a custom framework then I assume the framework needs to be tailored to your needs, otherwise you would use one that is already available. So figure out what your needs are and go from there ;)
What are the most often repeated operations in your application? Is there a division of labor that a framework could make more apparent?

Lightweight MVC - no framework [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Hi sorry if this is a naive question, but what did people do before mvc frameworks became so popular? All you hear of nowadays, and im talking php here, are mvc, Zend etc but what did developers do beforehand?
Are there some developers who use the mvc pattern but without a framework - if so how do they do this and is it really complicated to set up?
MVC is a design pattern. You can easily roll your own MVC "framework" (technically even without using object-oriented programming). The main goal is simply to have a separation between data storage, business logic, and presentation.
When I was first learning about MVC, I decided that trying to sift through the mountains of code of CakePHP or other frameworks was simply too complicated. I started writing my own "framework" using this tutorial (http://fuelyourcoding.com/php-frameworks-just-roll-your-own-part-1/). It's really not as much work as you think (you can go through that tutorial in a day and have a very nice mini-MVC), and you can expand it later into a full-fledged framework later on if you have the time and dedication.
As to the question of what developers did before frameworks, well, they just wrote everything themselves. Unfortunately this led to a lot of spaghetti code with HTML mixed with PHP blocks and SQL statements, but that's not really a fault with not having a framework, rather with not trying to implement any sort of separation of concerns.
Edit: Part 2 is probably the most important part because it shows you how to make a template. This isn't actually the exact tutorial, the one I used seems to have disappeared.

Categories