Slides from a presentation given at Laravel Chicago on November 18, 2014. Goes over the basics of building a REST API using the Laravel framework as well as some handy tips and tools.
RESTful APIs are useful when developing a modern web application since they allow for multiple possibilities for collaboration with third-party software as well as multiple types of front-ends, such as mobile apps and HTML5 web applications. The creation of RESTful API’s is facilitated using Laravel 4, a PHP 5.3 Framework that is rapidly growing in popularity. Laravel’s features such as the facade pattern allow for easy-to-read code and expressive ORM statements.
Handling RESTful API requests with Laravel PHP Framework resource controllers is already very easy. With Laravel 5, handling request routing has been made even easier by using a configuration-as-annotation approach. Controller annotations may take advantage of doc block-style syntax and then be compiled using Laravel's artisan command-line tool. I'll present this approach by providing a few examples and discussing some of the pros and cons.
An exploration into what a WordPress theme is. How does it work and what is it made up of?
If you're interested in getting into theme development this presentation will help you get started on that journey.
This talk covers a successful utilization of Rails Engines to share features that cut across the layers of MVC in different Rails 3 projects. Rails Engines thus provide the best of both worlds: improved productivity by reusing MVC code (including assets like Javascript, CSS, and Images) and better flexibility by allowing different applications to customize behavior as needed without reliance on application-dependent conditionals. Rails Engine patterns will be provided to guide developers on how to leverage Rails Engines' reusability and flexibility without sacrificing maintainability.
Slides from a presentation given at Laravel Chicago on November 18, 2014. Goes over the basics of building a REST API using the Laravel framework as well as some handy tips and tools.
RESTful APIs are useful when developing a modern web application since they allow for multiple possibilities for collaboration with third-party software as well as multiple types of front-ends, such as mobile apps and HTML5 web applications. The creation of RESTful API’s is facilitated using Laravel 4, a PHP 5.3 Framework that is rapidly growing in popularity. Laravel’s features such as the facade pattern allow for easy-to-read code and expressive ORM statements.
Handling RESTful API requests with Laravel PHP Framework resource controllers is already very easy. With Laravel 5, handling request routing has been made even easier by using a configuration-as-annotation approach. Controller annotations may take advantage of doc block-style syntax and then be compiled using Laravel's artisan command-line tool. I'll present this approach by providing a few examples and discussing some of the pros and cons.
An exploration into what a WordPress theme is. How does it work and what is it made up of?
If you're interested in getting into theme development this presentation will help you get started on that journey.
This talk covers a successful utilization of Rails Engines to share features that cut across the layers of MVC in different Rails 3 projects. Rails Engines thus provide the best of both worlds: improved productivity by reusing MVC code (including assets like Javascript, CSS, and Images) and better flexibility by allowing different applications to customize behavior as needed without reliance on application-dependent conditionals. Rails Engine patterns will be provided to guide developers on how to leverage Rails Engines' reusability and flexibility without sacrificing maintainability.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
Features are very useful for building Drupal profiles (re-usable applications). They provide a way to capture and save in code the customizations that are done to a Drupal site/application. Here I will describe how I use them in B-Translator.
Utiliser Webpack dans une application SymfonyAlain Hippolyte
Depuis la version 2.8 de Symfony, Assetic le gestionnaire d'assets PHP n'est plus inclus par défaut dans la Standard Edition. Du coup, se pose la question, faut-il encore l'utiliser ? Quels sont les alternatives qui s'offrent à nous ?
Au cours de cette présentation, je vous présenterai l'outil Webpack, qui permet de packager nos assets via une configuration. Étape par étape, nous verrons comment migrer une application Symfony utilisant Assetic vers une application Symfony avec Webpack, du dev à la production.
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
Le moyen le plus rapide d'obtenir une réponse d'un Backend est de ne pas l'appeler ;-) Une solution fournie par les "reverse-proxy" me direz-vous, mais pas si simple d'invalider le cache...
Ce talk aborde une fonctionnalité méconnue de Varnish: les tags. Nous verrons comment en tirer partie via les "event listeners" d'une application Symfony standard. Au menu, un cluster de Rasberry Pi, une API, et des données toujours fraîches sous la milliseconde.
The session was about how to create the Restful Web Services with Laravel, a PHP framework with the minimal code. Topics discussed are:
-Laravel Philosophy
-Requirement
-Installation
-Basic Routing
-Requests & Input
-Request Lifecycle
-Creating A Migration
-Controller
-Controller Filters
-RESTful Controllers
-Database
-Eloquent ORM
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress ThemesPhilip Arthur Moore
These slides accompany a presentation given at WordCamp Singapore 2011 ( http://2011.singapore.wordcamp.org/ ) on the breaking of fixing of WordPress themes. Important plugins to aid in theme testing are discussed, as well as vital unit tests to perform before the public release of a WordPress theme.
Introduction to Module Development - Drupalgauravkumar87
Creating Modules to make Drupal Dance: An Introduction
This is a hands-on introductory course on module development. We start by introducing the structure of a well-written module and place it in the context of Drupal's architecture. Sometimes you will come across an existing module that almost does what you need but not quite -- we will talk about to extend that module. Occasionally you simply have to write a new module from scratch. You will have your ownl development sandbox as we work through the Drupal API. You will leave the class sufficient understanding of Drupal’s menu, form and hook systems and the database. Below is the sequence in which topics will be covered.
Drupal Architecture -- Technology Stack, Code Base, Database.
Module Architecture -- Difference between Core, Contributed, Custom Module
Building Blocks of module -- Different types of files and why we use them
How to create simple page using hook_menu
How to create a simple block using hook_block that can be displayed in any region.
How to create schema using hook_install and hook_schema
How to create a simple form using hook_form and various actions like validate and submit.
How to display messages and errors using drupal_set_message and drupal_set_error functions.
How to alter existing forms using hook_form_alter
How to theme a simple block using theme functions
How to set permissions using hook_perm to view the page created in step 4
How to use hook_nodeapi to do node operations
A demo module will be built using all the above hooks to demonstrate how various hooks works
Bonus Topics : How to use coder module for coding standards, How to debug a module using xdebug, How to use drupal with eclipse IDE.
Prerequisite: We assume you have working knowledge of PHP.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
Features are very useful for building Drupal profiles (re-usable applications). They provide a way to capture and save in code the customizations that are done to a Drupal site/application. Here I will describe how I use them in B-Translator.
Utiliser Webpack dans une application SymfonyAlain Hippolyte
Depuis la version 2.8 de Symfony, Assetic le gestionnaire d'assets PHP n'est plus inclus par défaut dans la Standard Edition. Du coup, se pose la question, faut-il encore l'utiliser ? Quels sont les alternatives qui s'offrent à nous ?
Au cours de cette présentation, je vous présenterai l'outil Webpack, qui permet de packager nos assets via une configuration. Étape par étape, nous verrons comment migrer une application Symfony utilisant Assetic vers une application Symfony avec Webpack, du dev à la production.
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
Le moyen le plus rapide d'obtenir une réponse d'un Backend est de ne pas l'appeler ;-) Une solution fournie par les "reverse-proxy" me direz-vous, mais pas si simple d'invalider le cache...
Ce talk aborde une fonctionnalité méconnue de Varnish: les tags. Nous verrons comment en tirer partie via les "event listeners" d'une application Symfony standard. Au menu, un cluster de Rasberry Pi, une API, et des données toujours fraîches sous la milliseconde.
The session was about how to create the Restful Web Services with Laravel, a PHP framework with the minimal code. Topics discussed are:
-Laravel Philosophy
-Requirement
-Installation
-Basic Routing
-Requests & Input
-Request Lifecycle
-Creating A Migration
-Controller
-Controller Filters
-RESTful Controllers
-Database
-Eloquent ORM
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress ThemesPhilip Arthur Moore
These slides accompany a presentation given at WordCamp Singapore 2011 ( http://2011.singapore.wordcamp.org/ ) on the breaking of fixing of WordPress themes. Important plugins to aid in theme testing are discussed, as well as vital unit tests to perform before the public release of a WordPress theme.
Introduction to Module Development - Drupalgauravkumar87
Creating Modules to make Drupal Dance: An Introduction
This is a hands-on introductory course on module development. We start by introducing the structure of a well-written module and place it in the context of Drupal's architecture. Sometimes you will come across an existing module that almost does what you need but not quite -- we will talk about to extend that module. Occasionally you simply have to write a new module from scratch. You will have your ownl development sandbox as we work through the Drupal API. You will leave the class sufficient understanding of Drupal’s menu, form and hook systems and the database. Below is the sequence in which topics will be covered.
Drupal Architecture -- Technology Stack, Code Base, Database.
Module Architecture -- Difference between Core, Contributed, Custom Module
Building Blocks of module -- Different types of files and why we use them
How to create simple page using hook_menu
How to create a simple block using hook_block that can be displayed in any region.
How to create schema using hook_install and hook_schema
How to create a simple form using hook_form and various actions like validate and submit.
How to display messages and errors using drupal_set_message and drupal_set_error functions.
How to alter existing forms using hook_form_alter
How to theme a simple block using theme functions
How to set permissions using hook_perm to view the page created in step 4
How to use hook_nodeapi to do node operations
A demo module will be built using all the above hooks to demonstrate how various hooks works
Bonus Topics : How to use coder module for coding standards, How to debug a module using xdebug, How to use drupal with eclipse IDE.
Prerequisite: We assume you have working knowledge of PHP.
Artificial intelligence (AI) is everywhere, promising self-driving cars, medical breakthroughs, and new ways of working. But how do you separate hype from reality? How can your company apply AI to solve real business problems?
Here’s what AI learnings your business should keep in mind for 2017.
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
Intro to drupal module internals ashevillecgmonroe
Slides for the Introduction to Drupal Internals talk given at DrupalCamp Ashville in 2014. See the youTube video at https://www.youtube.com/watch?v=WWC7bhFZOEk
This talk is intended to help non-programmers or programmers just starting to understand some of the basic structures that make up Drupal. OpenSource is great but often the documentation lacks. Knowing how to look around inside the code (even if you don't know how to code) can let you determine things that aren't documented.
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
Taking your module from Drupal 6 to Drupal 7Phase2
Learn how to take your module from D6 to D7 with this presentation from Senior Developer Tobby Hagler. This talk was given at CapitalCamp in Washington, DC.
Drupal8 modernization (new object-oriented base) and adoption of many Symfony components is a huge step in connecting these two amazing communities and amazing projects. Drupal8 is not powered by full-stack Symfony and there is still many differences between these two relatives, but still, Symfony developers should master it easily.
This talk is for Symfony developers who don't have experience with Drupal8. It will guide you through routing, controllers, hooks, events, Drupal Console, DI and many other interesting elements that power Drupal8 under the hood. It will also show how to build custom modules Symfony way.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
3. Best Configuration
Web server: Apache is recommended.
PHP: Drupal requires PHP 4 (4.3.5 or greater) or PHP 5. Drupal core can work with PHP4
but most of contributed modules requires PHP5.
Databases: can be either MySQL or PostgreSQL.The Apache web server and MySQL
database are recommended.
Other web server and database combinations: such as IIS and PostgreSQL have been
tested to a lesser extent.
More information can be found at: http://drupal.org/requirements
4. Popular Issues
Memory limit: Drupal consumes more memory than other sources.Therefore,
you need have to increase memory limit for Drupal.
Clean URL: To use "Clean URLs" feature on an Apache web server, you will need
the mod_rewrite module and the access permission to local .htaccess files.
PHP: In rare cases, your hosting provides PHP4. Although Drupal can still runs
with PHP 4.3.5, but many contributed modules will not work properly with PHP4.
So you should ensure your PHP version is 5 and above.
7. Core Modules
Ships with a Standard Drupal Release
There are Core Optional and Core Required modules
For example:
Node => /admin/structure/types
User => /admin/config/people
Block => /admin/structure/block
System => /admin/config/system
Filter => /admin/config/content/formats
Menu => /admin/structure/menu
8. Contributed Modules
Over 14,297 free community- contributed modules, known as contributed modules,
are available to
1. Alter and extend Drupal's core capabilities
2. Add new features
3. Customize site's behavior and appearance
9. Custom Module
1. Local to your Drupal Project
2. Not yet contributed to the contributed repository
10. Custom Module(When to write)
You need to answer few questions before writing a Custom Module
1. What do you want to achieve by this custom module?
2. Did you search the Contrib Repository to see if a module is already available for
that feature?
3. Have you enabled all possible Configurations of the Core & Contrib module to
check if they offer you the feature you require?
.If your answer is,“Yes, I have done enough research and am sure I have to write
the code now”, then go ahead ....
11. Custom Module(Why to write)
I have 2 reasons to write a Custom module
1. I need a new feature which is not yet available in Drupal, and probably can be
contributed as a Contrib Module.
2. I don't want to keep adding additional modules to my site for small tweaks, which I can
manage in only one custom module for my website. Don't be too much dependent on
Contribs.
3. Performance.
– Good modules are abstract
– Abstraction can be slow
– Slow is bad
– Custom tailored code can be faster
19. hooks
Allow modules to interact with the Drupal core.
Drupal's module system is based on the concept of "hooks".
A hook is a PHP function that is named foo_bar(), where "foo" is the name of the
module (whose filename is thus foo.module) and "bar" is the name of the hook.
Each hook has a defined set of parameters and a specified result type.
https://api.drupal.org/api/drupal/includes!module.inc/group/hooks/7
20. hook_boot
Perform setup tasks for all page requests.
This hook is run at the beginning of the page request.
It is typically used to set up global parameters that are needed later in the request.
21. hook_init
Perform setup tasks for non-cached page requests.
This hook is run at the beginning of the page request.
It is typically used to set up global parameters that are needed later in the request.
When this hook is called, the theme and all modules are already loaded in
memory.
This hook is not run on cached pages.
22. hook_menu
Define menu items and page callbacks.
This hook enables modules to register paths in order to define how URL requests
are handled.
Paths may be registered for URL handling only, or they can register a link to be
placed in a menu (usually the Navigation menu).
A path and its associated information is commonly called a "menu router item".
This hook is rarely called (for example, when modules are enabled), and its results
are cached in the database.
23. hook_menu
Each menu item has a key corresponding to the Drupal path being registered.
The corresponding array value is an associative array that may contain the following key-value pairs.
1. "title": Required.The untranslated title of the menu item.
2. "description":The untranslated description of the menu item.
3. "page callback":The function to call to display a web page when the user visits the path. If
omitted, the parent menu item's callback will be used instead.
4. "delivery callback":The function to call to package the result of the page callback function and
send it to the browser.
5. "file": A file that will be included before the page callback is called;
.https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu/7
24. hook_menu
"type": A bitmask of flags describing properties of the menu item. Many shortcut
bitmasks are provided as constants in menu.inc:
MENU_NORMAL_ITEM: Normal menu items show up in the menu tree and can
be moved/hidden by the administrator. Use this for most menu items. It is the
default value if no menu item type is specified.
MENU_CALLBACK: Callbacks simply register a path so that the correct function
is fired when the url/path is accessed.
25. Node
All content on a Drupal website is stored and treated as "nodes".
A node is any posting, such as a page, poll, article, forum topic, or blog entry.
Comments are not stored as nodes but are always tied to one.
Treating all content as nodes allows the flexibility of creating new types of content.
It also allows you to painlessly apply new features or changes to all content.
https://drupal.org/documentation/modules/node
27. Hook_node_insert
Respond to creation of a new node.
This hook is invoked from node_save() after the database query that will insert the
node into the node table is scheduled for execution, after the type-specific
hook_insert() is invoked, and after field_attach_insert() is called.
https://api.drupal.org/api/drupal/modules!node!
node.api.php/group/node_api_hooks/7
28. Hook_node_update
Respond to updates to a node.
This hook is invoked from node_save() after the database query that will update
node in the node table is scheduled for execution, after the type-specific
hook_update() is invoked, and after field_attach_update() is called.
https://api.drupal.org/api/drupal/modules!node!
node.api.php/group/node_api_hooks/7
29. Hook_node_delete
Respond to node deletion.
This hook is invoked from node_delete_multiple() after the type-specific
hook_delete() has been invoked, but before hook_entity_delete and
field_attach_delete() are called, and before the node is removed from the node
table in the database.
https://api.drupal.org/api/drupal/modules!node!
node.api.php/group/node_api_hooks/7
30. Form APi
Functions to enable the processing and display of HTML forms.
Drupal uses these functions to achieve consistency in its form processing and
presentation, while simplifying code and reducing the amount of HTML that must
be explicitly generated by modules.
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7
31. Create Form
The process for creating a form is mainly two steps.
1. The first is to build an associative array $form that contains all the fields.
2. The second step is to return that $form variable.
33. Create Form
It is important to note that the function takes the inputs $form, and a reference
&$form_state.
This function will be called when Drupal tries to build the form
"form_example_form.“
34. Validate and submit form
Now that we have a form, we need to add two more function:
1. form_example_form_validate, and
2. form_example_form_submit.
.These two functions are hook functions that will be called when Drupal validates
the form and when it submits the form (assuming it validated).
.These two functions need to named similar to the other form, but with "validate"
and "submit" at the end.
35. $form and $form_State
You will note that these three functions take the same variables.
1. $form is the original form information and can be seen as the original structure
of the form.
2. $form_state holds all of the submitted values as well as other information, some
of which you can add yourself.
36. Show form
We want to see the form!!!
1. We will add a menu link to this form.
2. Show form in a Block
37. What to do when your form is submitted?
From this point, you will want to either
1. save the form data,
2. send an email, or
3. display some information.
39. Alter Form
Perform alterations before a form is rendered.
One popular use of this hook is to add form elements to the node form.
When altering a node form, the node object can be accessed at $form['#node'].
https://api.drupal.org/api/drupal/modules!system!
system.api.php/function/hook_form_alter/7
40. Ajax in Form
Drupal supports ajax in forms
Example
https://api.drupal.org/api/examples/ajax_example!ajax_example.module/7
42. Database API
The Drupal 7 Database API provides a standard, vendor-agnostic abstraction layer
for accessing database servers.
43. Database abstraction layer
Allow the use of different database servers using the same code base.
Most Drupal database SELECT queries are performed by a call to db_query() or
db_query_range()
For example, one might wish to return a list of the most recent 10 nodes authored
by a given user. Instead of directly issuing the SQL query
SELECT n.nid, n.title, n.created FROM noden WHERE n.uid = $uid LIMIT 0, 10;
one would instead call the Drupal functions:
$result = db_query_range('SELECT n.nid, n.title, n.created
FROM {node} n WHERE n.uid = :uid', 0, 10, array(':uid' => $uid));
foreach ($result as$record) {
// Perform operationson $record->title, etc. here.
}
45. Transactions
function my_transaction_function() {
// Thetransaction openshere.
$txn = db_transaction(); try {
// Your codehere.
} catch (Exception $e) {
// Something went wrong somewhere, so roll back
now.
$txn->rollback();
// Log theexception to watchdog.
watchdog_exception('type', $e);
}
https://api.drupal.org/api/drupal/includes!database!database.inc/group/database/7
46. Web Services
Create a Menu
Menu “delivery_callback” should be => ‘ajax_deliver’
Write drupal_exit() at end of menu function
Flush cache
47. Theming in drupal
The first step is that logic must be separated as much as possible from presentation.
To accomplish this, modules do as much of the work on the data as possible, and
hand that data off to the presentation layer.
This is handled through the theme() function.
49. Theme Hook
Register a module (or theme's) theme implementations.
Every chunk of output that is themed through the theme() function is called a theme
hook.
In order to utilize a theme hook, your module first has to register that this exists.
50. Implement theme functions
Drupal allows you to use functions for your default theme implementations.
This is somewhat faster performance than loading template files.
New in Drupal 7, theme functions can have preprocess functions just like templates.
Copying and modifying template files is still considered more friendly for themers.
Theme functions are named by prepending 'theme_' to the name of the hook.
The arguments given to theme('hook') will be passed straight through, unaltered.
52. Implement default templates
When implemented as a template, the .tpl.php file is required.
It should be in the same directory as the .module file (though the 'path' directive
can be used to place these templates in another directory or a sub-directory).
Templates should be as much pure HTML as possible, but there are a few functions
that are explicitly encouraged in your templates:
1. t(): modules should always provide proper translatability, and templates are no
exception.
2. format_date(): since this function is, really, a presentation function, the presentation
layer is the appropriate place for it.
54. Performance: Reduce # of HTTP Requests
Problem:
80% of the end-user response time is spent on the front-end.
Most of this time is tied up in downloading all the components (images, style-
sheets, scripts, Flash) in the page.
Reducing the number of components in turn reduces the number of HTTP requests
required to render the page.This is the key to faster pages.
Solution:
Turn on Bandwidth optimizations for CSS and JavaScript files Manual CSS sprite
generator
Go for Bootstrap
Use Yslow firefox plugin
55. Performance: Cache
Caching using Boost
Extension of Performance module
Instead of caching results in tables, stores them in files bypassing PHP and MySQL
Limited to anonymous visitors – Not for sites with high number of authenticated
visitors
How it works:
Uses apache mod_rewrite directives in .htacess to check if GET
Logged in cookie does not exist
HTML file cached on file-system