SlideShare a Scribd company logo
www.backand.com
AngularJS with Slim PHP
Micro Framework
AngularJS is a popular front-end framework that can be used
with many server-side technologies. In many AngularJS web
applications, each web page is really a single-page application
(SPA),so the role of the server-side is really an API consisting of
a set of web services to interact with the server-side databases.
SPA
A recent web application that I constructed with AngularJS, has a master-
detail structure consisting of two pages:
1. master – list of items
2. detail – item
Items can be edited and saved in the details screen. Limited editing of items
can be done in the master screen.
The application structure was built starting from the Angular-seed project,
with two pages at the root, respectively:
1. list.html
2. index.html
www.backand.com
Each page was a SPA. There were separate services for interacting with the
server-side for the two pages, respectively.
If you know of other sites offering free Bootstrap templates, feel free to send
me a link and I will add it to this growing list.
The Server-Side
The server-side is to provide a set of REST web services that fetch data from
a server-side database.
The Slim PHP micro framework was chosen to construct the server-side
because it lends itself to simple construction of REST web services (see
Writing a RESTful Web Service with Slim) that was used as the basis.
The NotORM ORM was used to do the database calls in an abstract way that
could be ported different types of database servers.
We have two tables ‘list’ and ‘item’, corresponding to the master and detail,
respectively.
AngularJS HTTP Calls
AngularJS services use ‘$http’ to make web service calls for CRUD operations
using ‘GET’, ‘POST’, ‘PUT’ and ‘DELETE’. These calls fetch and send JSON data.
Here is an example ‘POST’ call to create a new item:
www.backand.com
Web Services
The construction of the web services was just a few lines of code.
Slim Configuration
First, the Slim configuration:
GET
A straightforward GET call that will fetch an item in a JSON format:
www.backand.com
POST
A POST call transmitting data at the body required a conversion to the right
format, using ‘get_object_vars’ to convert the JSON at the body of the request
into a PHP associative array:
Contact Information
Backand Inc.
info@backand.com
www.backand.com
Notice
This document has been carefully compiled. The information in this guide does not constitute a warranty
of performance. Furthermore, Backand reserves the right to revise this publication and make changes from
time to time in the content thereof, without obligation to notify any person of such revisions or changes.
Backand assumes no liability for losses incurred as a result of out-of-date or incorrect information in this
guide. The software described in this guide is furnished under a license agreement and may be used only
according to the terms of that agreement.

More Related Content

What's hot (20)

PDF
Hello World on Slim Framework 3.x
Ryan Szrama
 
PDF
Keeping it Small: Getting to know the Slim Micro Framework
Jeremy Kendall
 
PPT
Slim RedBeanPHP and Knockout
Vic Metcalfe
 
PDF
Using the new WordPress REST API
Caldera Labs
 
PDF
Build REST API clients for AngularJS
Almog Baku
 
PDF
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
 
PDF
ACL in CodeIgniter
mirahman
 
PDF
Getting Started-with-Laravel
Mindfire Solutions
 
PDF
Bootstrat REST APIs with Laravel 5
Elena Kolevska
 
PPTX
REST APIs in Laravel 101
Samantha Geitz
 
PDF
Silex Cheat Sheet
Andréia Bohner
 
ODP
Javascript laravel's friend
Bart Van Den Brande
 
PDF
Introduction to plugin development
Caldera Labs
 
PPT
Zend Framework 1.8 Features Webinar
Ralph Schindler
 
PDF
RESTful API Design & Implementation with CodeIgniter PHP Framework
Bo-Yi Wu
 
PPT
Building Single Page Application (SPA) with Symfony2 and AngularJS
Antonio Peric-Mazar
 
PDF
Introduction à Ruby
Microsoft
 
PPTX
Service approach for development REST API in Symfony2
Sumy PHP User Grpoup
 
PPTX
SPA using Rails & Backbone
Ashan Fernando
 
PPTX
Zend framework
Prem Shankar
 
Hello World on Slim Framework 3.x
Ryan Szrama
 
Keeping it Small: Getting to know the Slim Micro Framework
Jeremy Kendall
 
Slim RedBeanPHP and Knockout
Vic Metcalfe
 
Using the new WordPress REST API
Caldera Labs
 
Build REST API clients for AngularJS
Almog Baku
 
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
 
ACL in CodeIgniter
mirahman
 
Getting Started-with-Laravel
Mindfire Solutions
 
Bootstrat REST APIs with Laravel 5
Elena Kolevska
 
REST APIs in Laravel 101
Samantha Geitz
 
Silex Cheat Sheet
Andréia Bohner
 
Javascript laravel's friend
Bart Van Den Brande
 
Introduction to plugin development
Caldera Labs
 
Zend Framework 1.8 Features Webinar
Ralph Schindler
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
Bo-Yi Wu
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Antonio Peric-Mazar
 
Introduction à Ruby
Microsoft
 
Service approach for development REST API in Symfony2
Sumy PHP User Grpoup
 
SPA using Rails & Backbone
Ashan Fernando
 
Zend framework
Prem Shankar
 

Similar to AngularJS with Slim PHP Micro Framework (20)

PDF
What are the reasons behind growing popularity of AngularJS.pdf
mohitd6
 
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
PPTX
Angular jS Introduction by Google
ASG
 
PPTX
The Growing Popularity of AngularJS
Whiz Solutions
 
PPTX
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
reneechemel
 
PPTX
REST Easy with AngularJS - ng-grid CRUD Example
Backand Cohen
 
PDF
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
OptiSol Business Solutions
 
PDF
A white paper on Fundamentals and Implementations of Angular JS
OptiSol Business Solutions
 
PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Eric Greene
 
PDF
AngularJS in Production (CTO Forum)
Alex Ross
 
PDF
Angular js gtg-27feb2013
Nitya Narasimhan
 
PDF
Modern webtechnologies
Besjan Xhika
 
PPTX
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
PDF
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
PPTX
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
PDF
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
PPTX
Overview about AngularJS Framework
Camilo Lopes
 
PPTX
The Best Web Development Services And Company in Usa
TechnoProfiles Pvt. Ltd.
 
PPTX
Untangling the web10
Derek Jacoby
 
What are the reasons behind growing popularity of AngularJS.pdf
mohitd6
 
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
Angular jS Introduction by Google
ASG
 
The Growing Popularity of AngularJS
Whiz Solutions
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
reneechemel
 
REST Easy with AngularJS - ng-grid CRUD Example
Backand Cohen
 
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
OptiSol Business Solutions
 
A white paper on Fundamentals and Implementations of Angular JS
OptiSol Business Solutions
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Eric Greene
 
AngularJS in Production (CTO Forum)
Alex Ross
 
Angular js gtg-27feb2013
Nitya Narasimhan
 
Modern webtechnologies
Besjan Xhika
 
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
Overview about AngularJS Framework
Camilo Lopes
 
The Best Web Development Services And Company in Usa
TechnoProfiles Pvt. Ltd.
 
Untangling the web10
Derek Jacoby
 
Ad

More from Backand Cohen (8)

PDF
Start an Angular project fast, then go faster using AWS and Back&
Backand Cohen
 
PDF
Five Common Angular Mistakes
Backand Cohen
 
PDF
ng-grid and a Simple REST API
Backand Cohen
 
PDF
How to Build Dynamic Forms in Angular Directive with a Backend
Backand Cohen
 
PDF
Testing Two-Way Data Binding in AngularJS
Backand Cohen
 
PPTX
Backand Presentation
Backand Cohen
 
PDF
How-to Increase User Engagement by 25% with User Segmented Push Notifications
Backand Cohen
 
PDF
The Enterprise Excel Hell
Backand Cohen
 
Start an Angular project fast, then go faster using AWS and Back&
Backand Cohen
 
Five Common Angular Mistakes
Backand Cohen
 
ng-grid and a Simple REST API
Backand Cohen
 
How to Build Dynamic Forms in Angular Directive with a Backend
Backand Cohen
 
Testing Two-Way Data Binding in AngularJS
Backand Cohen
 
Backand Presentation
Backand Cohen
 
How-to Increase User Engagement by 25% with User Segmented Push Notifications
Backand Cohen
 
The Enterprise Excel Hell
Backand Cohen
 
Ad

Recently uploaded (20)

PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Human Resources Information System (HRIS)
Amity University, Patna
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 

AngularJS with Slim PHP Micro Framework

  • 1. www.backand.com AngularJS with Slim PHP Micro Framework AngularJS is a popular front-end framework that can be used with many server-side technologies. In many AngularJS web applications, each web page is really a single-page application (SPA),so the role of the server-side is really an API consisting of a set of web services to interact with the server-side databases. SPA A recent web application that I constructed with AngularJS, has a master- detail structure consisting of two pages: 1. master – list of items 2. detail – item Items can be edited and saved in the details screen. Limited editing of items can be done in the master screen. The application structure was built starting from the Angular-seed project, with two pages at the root, respectively: 1. list.html 2. index.html
  • 2. www.backand.com Each page was a SPA. There were separate services for interacting with the server-side for the two pages, respectively. If you know of other sites offering free Bootstrap templates, feel free to send me a link and I will add it to this growing list. The Server-Side The server-side is to provide a set of REST web services that fetch data from a server-side database. The Slim PHP micro framework was chosen to construct the server-side because it lends itself to simple construction of REST web services (see Writing a RESTful Web Service with Slim) that was used as the basis. The NotORM ORM was used to do the database calls in an abstract way that could be ported different types of database servers. We have two tables ‘list’ and ‘item’, corresponding to the master and detail, respectively. AngularJS HTTP Calls AngularJS services use ‘$http’ to make web service calls for CRUD operations using ‘GET’, ‘POST’, ‘PUT’ and ‘DELETE’. These calls fetch and send JSON data. Here is an example ‘POST’ call to create a new item:
  • 3. www.backand.com Web Services The construction of the web services was just a few lines of code. Slim Configuration First, the Slim configuration: GET A straightforward GET call that will fetch an item in a JSON format:
  • 4. www.backand.com POST A POST call transmitting data at the body required a conversion to the right format, using ‘get_object_vars’ to convert the JSON at the body of the request into a PHP associative array: Contact Information Backand Inc. [email protected] www.backand.com Notice This document has been carefully compiled. The information in this guide does not constitute a warranty of performance. Furthermore, Backand reserves the right to revise this publication and make changes from time to time in the content thereof, without obligation to notify any person of such revisions or changes. Backand assumes no liability for losses incurred as a result of out-of-date or incorrect information in this guide. The software described in this guide is furnished under a license agreement and may be used only according to the terms of that agreement.