Drupal 9 Module Development

Námskeið
-
T-430-TOVH Þróun opins vefhugbúnaðar
Lýsing:
Build and extend flexible Drupal sites and applications with this up-to-date, expert guide to Drupal 9 module development Publisher's note: A new edition, updated for Drupal 10 architecture and features to build custom modules has now been published and is available Key Features Explore the essential Drupal 9 APIs for module development Learn how to implement data modeling, caching, architecture, and much more in your Drupal applications Discover what's new in the latest Drupal core release Book Description With its latest release, Drupal 9, the popular open source CMS platform has been updated with new functionalities for building complex Drupal apps with ease.
This third edition of the Drupal Module Development guide covers these new Drupal features, helping you to stay on top of code deprecations and the changing architecture with every release. The book starts by introducing you to the Drupal 9 architecture and its subsystems before showing you how to create your first module with basic functionality. You’ll explore the Drupal logging and mailing systems, learn how to output data using the theme layer, and work with menus and links programmatically.
Once you’ve understood the different kinds of data storage, this Drupal guide will demonstrate how to create custom entities and field types and leverage the Database API for lower-level database queries. You’ll also learn how to introduce JavaScript into your module, work with various file systems, and ensure that your code works on multilingual sites. Finally, you’ll work with Views, create automated tests for your functionality, and write secure code.
By the end of the book, you’ll have learned how to develop custom modules that can provide solutions to complex business problems, and who knows, maybe you’ll even contribute to the Drupal community! What you will learn Develop custom Drupal 9 modules for your applications Master different Drupal 9 subsystems and APIs Model, store, manipulate, and process data for effective data management Display data and content in a clean and secure way using the theme system Test your business logic to prevent regression Stay ahead of the curve and write PHP code by implementing best practices Who this book is for If you are a Drupal developer looking to learn Drupal 9 to write modules for your sites, this book is for you.
Annað
- Höfundur: Daniel Sipos, Antonio De Marco
- Útgáfa:3
- Útgáfudagur: 2020-08-14
- Hægt að prenta út 10 bls.
- Hægt að afrita 10 bls.
- Format:ePub
- ISBN 13: 9781800200548
- Print ISBN: 9781800204621
- ISBN 10: 1800200544
Efnisyfirlit
- Drupal 9 Module Development
- Third Edition
- Why subscribe?
- Foreword
- Contributors
- About the author
- About the reviewers
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- Chapter 1: Developing for Drupal 9
- Introducing Drupal (for developers)
- How did we get to Drupal 9?
- Developing for Drupal
- Technologies that drive Drupal
- PHP
- Databases and MySQL
- The web server
- Drupal architecture
- Drupal's major subsystems
- Tools for developing in Drupal
- Summary
- Chapter 2: Creating Your First Module
- Creating a module
- Your first hook implementation
- Route and controller
- Services
- Using services in Drupal
- Injecting the service into our Controller
- Invoked Controllers
- The Form API
- Altering forms
- Custom submit handlers
- Rendering forms
- Service dependencies
- Blocks
- Our first block plugin
- Block configuration
- Working with links
- The URL
- The link
- Which way to link?
- Event Dispatcher and redirects
- Redirecting from a Controller
- Redirecting from a subscriber
- Dispatching events
- Summary
- Creating a module
- Chapter 3: Logging and Mailing
- Logging
- The Drupal logging theory
- Our own logger channel
- Our own logger
- Logging for Hello World
- Logging recap
- Mail API
- The theory behind the Mail API
- Implementing hook_mail()
- Sending emails
- Altering someone else's emails
- Custom mail plugins
- Mail API recap
- Tokens
- The Token API
- Using tokens
- Defining new tokens
- Tokens recap
- Summary
- Logging
- Chapter 4: Theming
- Business logic versus presentation logic
- Twig
- Theme hooks
- Theme hook suggestions
- Render arrays
- The structure of a render array
- The render pipeline
- Assets and libraries
- Libraries
- Common theme hooks
- Lists
- Links
- Tables
- Attributes
- Layouts
- Defining layouts
- Rendering a layout
- Theming our Hello World module
- Summary
- Chapter 5: Menus and Menu Links
- The menu system
- Menus
- Menu links
- MenuLink trees
- Rendering menus
- Working with menu links
- Defining menu links
- Manipulating menu links
- Defining local tasks
- Defining local actions
- Defining contextual links
- Summary
- The menu system
- Chapter 6: Data Modeling and Storage
- Different types of data storage
- State API
- TempStore
- Private TempStore
- Shared TempStore
- Tempstore recap
- UserData API
- Configuration API
- Introduction
- Configuration storage
- Configuration recap
- Entities
- Content versus configuration entity types
- Entity type plugins
- Fields
- Entity types recap
- TypedData
- Why TypedData?
- What is TypedData?
- The low-level API
- Content entities
- TypedData recap
- Interacting with the Entity API
- Querying entities
- Loading entities
- Reading entities
- Manipulating entities
- Creating entities
- Rendering content entities
- Pseudo-fields
- Entity validation
- Summary
- Chapter 7: Your Own Custom Entity and Plugin Types
- Our custom content entity type
- Entity updates
- Our custom plugin type
- Our custom configuration entity type
- The Importer plugin
- Content entity bundles
- Our own Drush command
- Summary
- Our custom content entity type
- Chapter 8: The Database API
- The Schema API
- Running queries
- Select queries
- Pagers
- Insert queries
- Update queries
- Delete queries
- Transactions
- Query alters
- Update hooks
- Post update hooks
- Summary
- Chapter 9: Custom Fields
- A recap of Field type plugins
- Field type
- Field widget
- Field formatter
- Field settings
- Using our custom field type as a base field
- Summary
- Chapter 10: Access Control
- Introduction to the Drupal access system
- Roles and permissions under the hood
- Defining permissions
- Checking the user credentials
- Route access
- Custom route access
- Programmatically checking access on routes
- Bonus – dynamic route options for access control
- CSRF protection on routes
- Altering routes
- Entity access
- Injecting services into Entity handlers
- Entity access hooks
- Field access
- Entity access in routes
- Node access grants
- Block access
- Summary
- Introduction to the Drupal access system
- Chapter 11: Caching
- Introduction to caching
- Cacheability metadata
- Cache tags
- Cache contexts
- Max-age
- Using the cache metadata
- Placeholders and lazy building
- Lazy builders
- Using the Cache API
- Creating our own cache bin
- Summary
- Chapter 12: JavaScript and the Ajax API
- JavaScript in Drupal
- Drupal behaviors
- Drupal settings
- The Ajax API
- Ajax links
- Ajax in forms
- The States (Form) system
- Summary
- JavaScript in Drupal
- Chapter 13: Internationalization and Languages
- Introduction to the multilingual ecosystem
- Language
- Content translation
- Configuration translation
- Interface translation
- Internationalization
- Content entities and the Translation API
- Summary
- Introduction to the multilingual ecosystem
- Chapter 14: Batches, Queues, and Cron
- Batch-powered update hooks
- Batch operations
- Creating the batch
- Batch operations
- Cron
- Queues
- Introduction to the Queue API
- Cron-based queues
- Processing a queue programmatically
- The Lock API
- Summary
- Chapter 15: Views
- Entities in Views
- Exposing custom data to Views
- Views data
- Custom Views field
- Field configuration
- Custom Views filter
- Custom Views argument
- Views theming
- Views hooks
- Summary
- Chapter 16: Working with Files and Images
- The filesystem
- Stream wrappers
- Managed versus unmanaged files
- Using the File and Image fields
- Working with managed files
- Attaching managed files to entities
- Helpful functions for dealing with managed files
- Managed file uploads
- Our own stream wrapper
- Working with unmanaged files
- Private filesystem
- Images
- Image toolkits
- Image styles
- Rendering images
- Summary
- Chapter 17: Automated Testing
- Testing methodologies in Drupal 9
- PHPUnit
- Registering tests
- Unit tests
- Mocked dependencies
- Kernel tests
- TeamCleaner test
- CsvImporter test
- Functional tests
- Configuration for Functional tests
- Hello World page test
- Hello World form test
- Functional JavaScript tests
- Time test
- CsvImporter test
- Summary
- Chapter 18: Drupal Security
- Cross-Site Scripting (XSS)
- Sanitization methods in Drupal 9
- Double escaping
- SQL Injection
- Cross-Site Request Forgery (CSRF)
- Summary
- Cross-Site Scripting (XSS)
- Other Books You May Enjoy
- Leave a review - let other readers know what you think
UM RAFBÆKUR Á HEIMKAUP.IS
Bókahillan þín er þitt svæði og þar eru bækurnar þínar geymdar. Þú kemst í bókahilluna þína hvar og hvenær sem er í tölvu eða snjalltæki. Einfalt og þægilegt!
Rafbók til eignar
Rafbók til eignar þarf að hlaða niður á þau tæki sem þú vilt nota innan eins árs frá því bókin er keypt.
Þú kemst í bækurnar hvar sem er
Þú getur nálgast allar raf(skóla)bækurnar þínar á einu augabragði, hvar og hvenær sem er í bókahillunni þinni. Engin taska, enginn kyndill og ekkert vesen (hvað þá yfirvigt).
Auðvelt að fletta og leita
Þú getur flakkað milli síðna og kafla eins og þér hentar best og farið beint í ákveðna kafla úr efnisyfirlitinu. Í leitinni finnur þú orð, kafla eða síður í einum smelli.
Glósur og yfirstrikanir
Þú getur auðkennt textabrot með mismunandi litum og skrifað glósur að vild í rafbókina. Þú getur jafnvel séð glósur og yfirstrikanir hjá bekkjarsystkinum og kennara ef þeir leyfa það. Allt á einum stað.
Hvað viltu sjá? / Þú ræður hvernig síðan lítur út
Þú lagar síðuna að þínum þörfum. Stækkaðu eða minnkaðu myndir og texta með multi-level zoom til að sjá síðuna eins og þér hentar best í þínu námi.
Fleiri góðir kostir
- Þú getur prentað síður úr bókinni (innan þeirra marka sem útgefandinn setur)
- Möguleiki á tengingu við annað stafrænt og gagnvirkt efni, svo sem myndbönd eða spurningar úr efninu
- Auðvelt að afrita og líma efni/texta fyrir t.d. heimaverkefni eða ritgerðir
- Styður tækni sem hjálpar nemendum með sjón- eða heyrnarskerðingu
- Gerð : 208
- Höfundur : 17085
- Útgáfuár : 2020
- Leyfi : 379