How to run PHP as backend and Angular as frontend [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 2 years ago.
Improve this question
I have a project and using angular as front end and PHP as back end, installed both in different domains, PHP project is complete and working. I have created API in PHP and in angular I will call that API.
can I do like copy PHP project into angular src folder and run or using different domains how can I call API Or how?
what is the most used way for doing this I have seen tutorials over this but not able to get it correctly?
so can you please tell me any way to work,please give me your suggestion and thoughts

This is quite a big question really.
No-one will be able to give you an answer as to how to do what you're trying to achieve in a single stackoverflow post. It's like asking "how do I build a car?" - there are many steps involved to complete this process. Your best bet is to follow a tutorial.
In my experience, having separate applications for front end and backend is quite common.
You should keep your PHP project separate to your Angular project instead of mixing them.
You should follow a tutorial on how to build a full stack application such as these:
https://morioh.com/p/f2ad5d91a8dd
https://phpenthusiast.com/blog/develop-angular-php-app-getting-the-list-of-items
https://www.techiediaries.com/angular/angular-9-php-mysql-database/
Good luck!

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.

Most simple way to load content and keep it on the phone from the web? (PhoneGap) [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 created an app with PhoneGap but I need to load some stuff from another domain. I tried jQuery load with a xdomainload plugin but It did not work.
The stuff I need to show run on PHP as the back-end language. I'm really noob - I've seen a few tutorials about JSON but all of them did not work and I ended giving up. Is JSON the easiest way?
Thank you all
Generally speaking, PHP wont run client-side in Cordova. If you're trying to access some sort of backend service that you built using PHP, then that's doable with JSON. Whether it's "the easiest", makes this question to open for interpretation. Generally speaking, a common approach may be to use javascript to communicate with backend services which "talk" JSON between each other. This question might get closed for being to opinion based. But that's my 2 cents.

PHP Ajax right structure [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 8 years ago.
Improve this question
I found a similar questions, but it's not exactly what I am looking for.
I write web site using php. For dynamic content I use jQuery Ajax.
I have 20-50 functions and I want to use Ajax to call these functions and take JSON.
Idea is to pass parametres via ajax POST. Pages works with database and job is done.
The question - how better organize it?
Should I create 50 separate pages like:
mysite.com/ajax/delete_project.php
mysite.com/ajax/delete_user.php
mysite.com/ajax/show_user_info.php
mysite.com/ajax/show_my_messages.php
mysite.com/ajax/show_my_tasks.php
mysite.com/ajax/send_message.php
.......
or create one page? or maybe i am completely wrong with all of that
Ideally you should be using a framework, such as Symfony. Otherwise, I usually keep all the functions for each content type in a single file. So you might have:
mysite.com/api/blog_posts.php which would implement GET, POST, PUT, DEL, etc... for all the blog posts. Meanwhile, mysite.com/api/messages.php would handle that for all messages.
You must start using an MVC framework if not using already. I would say Laravel should be a good choice, it's easy to learn, feature-rich and fun to work with. Start looking into Laravel Routes.
Moving to MVC is the best way to start getting into shape in your case.

PHP seamless 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 8 years ago.
Improve this question
Hello all and thanks for taking the time to view this.
I want to make a PHP application and I am about to start, but I want the front/backend to have as little page loads as possible, but I just don't know what to learn per se. I am torn as to whether I should learn Ajax, AngularJS, EmberJS, NodeJS, BackboneJS, etc?
I really want to know if AJAX is the same as the others I listed or not. I just want to use PHP as the engine to fetch data from an SQL DB and make the application's front/backend seamlessly.
I would like to be pointed in the "right" direction as to which technology to take.
you can use angularJS for faster loading of pages, learning path is first you have knowledge of ajax, then you can learn AngularJs.
here is a reason why you can use angularJs
http://code.tutsplus.com/tutorials/3-reasons-to-choose-angularjs-for-your-next-project--net-28457
and you are going to use PHP as Backend so it eliminate node.js from this list, AngularJs is best as you have describe your requirement, if you know bit of javascript learning cure for angularJs is easy.

Tips for building my first API in CodeIgniter [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'm planning on building a private API for a CodeIgniter web application I have. I've found a tutorial for that which shows me how to do it using pre-built libraries.
I'm very new to this so my questions is: shall I use and rely on these libraries? or shall I learn how to build it from scratch in order to have complete control over it? also, do you have any tips of someone like me who's just getting started with APIs?
Of course it's up to you but I would really suggest using my libraries. The code has already been tried and tested by several large public web-apps and I recently added in key management, logging and request throttling.
Months of coding has gone into those libraries and they have been used to death, so it will be way easier that writing your own.
Just have a look through the code as you go so you understand how everything works. It's pretty flexible and getting more flexible as it goes.
When I decided that I was going to write an API, I was still in the early stages of learning CodeIgnitor so I didn't use it for developing the API. I think even now, I would probably still go the route of writing it all myself and not use a framework. This is mainly because I like to keep things as slim as possible and I feel that is more likely to happen without using a framework.
To get me started, I found this tutorial to be really helpful.

Categories