<formio> provides developers an easy drag & drop interface that creates both forms and the REST API's in one step!
You build the app, we handle the Form I/O.
Let's look at how the web has evolved.
Drupal as a Hub
Is this the right approach?
Forces us to develop our Drupal website like a web application.
"Headless Drupal"
Multi-Service Applications
Configure Drupal 8 for Web Services
/etc/apache2/sites-available/drupal8
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Methods "GET, PUT, POST, DELETE, OPTIONS"
Header set Access-Control-Allow-Headers "DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"
Order allow,deny
allow from all
drush dl drupal --default-major=8 --select --all
in AngularJS
http://yeoman.io/
mkdir drupal-angular
cd drupal-angular
npm install -g yo
npm install -g generator-angular
yo angular
app/scripts/app.js
.run(function($rootScope) {
$rootScope.baseUrl = 'http://drupal8';
})
yo angular:route movies
app/views/movies.html
Title
Video
{{ movie.title[0].value }}
{{ movie.field_youtube_url[0].uri }}
app/scripts/controllers/movies.js
.controller('MoviesCtrl', function ($scope, $rootScope, $http) {
$rootScope.activeNav = 'movies';
$scope.movies = [];
$http.get($rootScope.baseUrl + '/movie').success(function(result) {
$scope.movies = result;
});
});
yo angular:route movie-view --uri=movie/:id
app/views/movie-view.html
{{ movie.title[0].value }}
app/scripts/controllers/movie-add.js
.controller('MovieViewCtrl', function ($scope, $rootScope, $routeParams, $http) {
$scope.movie = {};
$http.get($rootScope.baseUrl + '/movie/' + $routeParams.id)
.success(function(result) {
$scope.movie = result[0];
}
);
});
app/scripts/app.js
.filter('safe', function($sce) {
return function(html) {
return $sce.trustAsHtml(html);
};
})
app/scripts/app.js.directive('youtube', function() { return { restrict: 'E', scope: { src: '=' }, templateUrl: 'views/youtube.html' }; })
.filter('trusted', function ($sce) { return function(url) { return $sce.trustAsResourceUrl(url); }; });
app/views/youtube.html
app/views/movie-view.html
{{ movie.title[0].value }}