angularJS within Symfony2? [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 7 years ago.
Improve this question
I have very basic Symfony2 application. I would like including AngularJS within it.
Where should I put my Angular resources?
How to include them?
How to communicate between Angular and Symfony
I see that official documentation says that I should split frontend and backend so that there cannot be any conflict.
Any scaffolding examples?

Well, Symfony2 is a backend framework, AngularJS a frontend framework. I would recommend building a REST API and have it return JSON. In AngularJS, you can use $resource to interact with the RESTful service.

As Angular resources must be directly accessible from the web browser in their entirety, you should put all these files within the [Symfony app root]/web/ directory. When an HTTP request requests a file located there, it will be served without interacting with the rest of the framework.
Optionally (and preferably) these pages can be pointed to with the routing component to make pretty URLs.
I agree with user3142446's answer about creating a REST API and allowing Angular to perform all of the heavy work. There's a well documented bundle for creating REST API's with Symfony called FOSRestBundle to get you started. By using this strategy you can utilize anything done in Symfony the same way you use external APIs.

Related

SNMP monitoring & Web interface [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 2 years ago.
Improve this question
I have read many articles, forums and informations about SNMP.
Even though I struggle with my project.
The goal of my project is to display data that I get from SNMP on a web page. (Nice designed interface). SNMP protocol is compulsory. And it should run on linux server (I want to add more devices in a final part of project e.g. router, switch.)
Could anyone tell me some quick info what has to be done (step by step review)?
I would be glad for every help. I am confused about what is the best way.
Ajax/database/websockets/traps?
I would like to use PHP or Node.js if it possible.
I'm doing a similar project for my internship :
I'm using Perl script for back-end with Net::SNMP for snmp request,
Perl CGI for front-end,
and JSON for DB.
I suggest using a framework to create the web interface, for example Django (https://www.djangoproject.com/) in python.
Then you could use a python library (pysnmp will be great) to retrieve the SNMP data, and create a custom View to show this data in a web page.
If you want to stick with PHP, you can use the functions described here http://php.net/manual/en/ref.snmp.php to access the SNMP server, and again using a framework will be great (Laravel, Symfony ...)

Connecting iOS app to a mysql database connected to a website that is currently online [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 6 years ago.
Improve this question
I have already created a website with a mysql database. Now, I am attempting to create an IOS app that will connect to the same database that my website "talks to". All of the tutorials I have seen have relied exclusively upon PHP and have walked through the process of creating the database. My website was not written with PHP, so I am completely lost on how I get PHP to help me in this case. I'm new to all this, so I am not sure what information is helpful, but so you know:
The website templates were written in HTML and CSS,
views page (functionality) written in python,
Flask is the microframework, and
pymysql is the ORM
Any pointers in the right direction would be much appreciated.
If you are using Flask then this is how you need to go through - there are other ways, but I would go for this -
Install Flask REST API to expose rest api from your site. You can get the documentation here - http://www.flaskapi.org/
Expose required API's from your website using flash rest api
Consume those API's with your mobile application.
NOTE: Don't ever expose your database directly to client side. BAD IDEA. Always use a middleware, could be php, python, .net - does not matter what it is.

Mobile/Web Application Backend [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 7 years ago.
Improve this question
I am currently working on a project where I need a backend for a mobile (iOS) and web application. For another project that I worked on a while ago, I used Parse.com as the backend since I did not have to deploy the application to the general public.
Since the application I want to launch may have a sudden burst of requests I wanted to use another service. Therefore, I am currently working on a PHP/MySQL backend that receives http requests and returns JSON encoded data.
Would this be an ideal setup for a scalable backend or is there any other service such as www.backendless.com that would enable me to have the same functionality without having to code everything myself?
I'm not an experienced backend developer and I am currently using most of my time on the backend and not working on the front-end.
Thanks.
PHP is a good language to start with and it's good enough (though not the best), first you need to choose a framework to help you getting what you want faster & more optimized and I suggest the Phalcon PHP framework, this one use some components from the C language which makes it faster than the others
After getting good in PHP please read more about the Restful APIs, because that's how you will handle the data for a mobile application.
And if you want a service for the backend like Parse I suggest Firebase for you, hope my answer helped. Good luck with your app.
Everyone knows Parse is going to be unavailable so next ready option for BaaS is Firebase but keep in mind there are many things that are not Supported by Firebase unlike Parse, for example image storing, push notifications ...
Another option is AWS Mobile Hub
I have been using Cakephp for my last 5 projects, creating backends to use as cms and as rest API (in my case I used JSON as response, but there are other formats). [http://book.cakephp.org/2.0/en/development/rest.html]
It is very easy to create your models, controllers and get started with your API. It also provides a lot of authentication methods, etc.
Parse is shutting down so it is not an option.

Internal server communication php [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 am building an app that will first be a web app and soon will get built into a mobile app.
My approach to this is. Have core app built and deployed on one machine. The web-app will be on a different machine (both on amazon). The web app is just ui wrapper in this situation. It will make all the calls to the core app to function.
My question here is. What is the best way for the webapp server and core app server to talk to each other?
Does everyone just use http calls for this purpose?
Are there any open-source tools/libraries that help here?
Platform : lamp with codeigniter on amazon.
You can create your own REST based API service and communicate to it from different applications. You can consider JSON as request and response data type, as it is most optimized and widely acceptable.
So, the technique is:
Separate application functions from front-end functions.
Let the API handle all the application functions.
Let your front-end system(s) call the application functions through the API.
Create restful web service for this purpose. Use JSON as an output data. This will make it easy to access in all platforms.
REST is my first choice. Since you mentioned that you are using codeigniter, this align with the way Codeigniter works. For the message type you can use json/XML , however since json is JavaScript object, I think you should use json.

Is Zend framework with backbone.js good idea? [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 7 years ago.
Improve this question
I am new to backbone.js and I would like to create my first medium scale website application with backbone.js. I used to create websites only with zend framework. My question is: Is zend framework to heavy to use with backbone.js, with that I mean if I should rather use some other rest frameworks for php (Slim)? Or in other words, what is a good server side framework/library to use with php?
We use zend framework and backbone.js and the integration works pretty well.
Zend framework (ZF1) offers an abstract rest controller, which automatically handles GET/POST/DELETE/PUT requests. http://framework.zend.com/apidoc/1.9/Zend_Rest/Zend_Rest_Controller.html
in our bootstrap, we set a module just for rest api controllers, called api. note your need to add a rest router for this module:
$restRoute = new Zend_Rest_Route($frontController);
$frontController->getRouter()->addRoute('oauth_route', $route, array('api')););
any controller in this module extends Zend_Rest_Controller and implements getAction, indexAction, deleteAction and so on.
PS. avoid Zend_Rest_Server & Zend_Rest_Client. these are old modules.
yiiframeworkis a good choice as a PHP framework.
Backbone.js is JavaScript MVC framework and all PHP frameworks including yiiframework are indeed PHP MVC frameworks, PHP has no conflict with Javascript. And yes of-course you can use backbone.js with any PHP framework.
http://www.yiiframework.com/wiki/390/yiibackboneboilerplate-project-setup-for-your-yii-backbonejs-applications/

Categories