A presentation on how to semi-automatically build CRUD application prototypes using PHP and some PEAR libraries. This was way before Rails became popular and automatic form generation for web applications was not as common as it is now.
Also, it was the first public presentation I ever held. Ah, those were the times ;-)
Originally held at the International PHP Conference 2004 in Amsterdam, although these slides have been updated by project contributors to reflect feature additions that were implemented later.
This document discusses the history and evolution of Rails form handling capabilities from Rails 1.0 through 2.0. Early versions used basic form_tag and text_field helpers that treated forms like hashes. Rails 1.1 introduced form_for to associate forms with model objects. Rails 2.0 integrated this with resource-based routes and conventions for form IDs and classes based on the model. Throughout, Rails aimed to bridge the gap between forms, controllers, models and the database in a seamless, object-oriented way.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
DrupalJam 2018 - Maintaining a Drupal Module: Keep It Small and SimpleAlexander Varwijk
This document discusses maintaining a Drupal module called Real-Time SEO. It provides background on the module, how it was originally built and maintained, and improvements made in recent versions. The key points are:
- Real-Time SEO analyzes content to provide SEO feedback and was originally built in collaboration with Yoast, but is now maintained by GoalGorilla.
- Version 1 only supported node content and a few fields. Recent updates added support for things like paragraphs and embedded media.
- The updates involved rendering content on the server and passing it to the Yoast analysis library, rather than just analyzing individual fields.
- A better approach is to use standard Drupal form and
This document discusses strategies for dealing with legacy PHP code, including separating controllers and views, removing dependencies on global variables, refactoring procedural code to be object-oriented, and untangling nested require statements. Specific problems in legacy PHP code are said to include mixing of PHP and HTML, overuse of requires instead of method calls, and excessive use of global variables. The document provides examples of refactoring code to address these issues.
The document discusses refactoring legacy PHP code, specifically dealing with code that has no separation between PHP and HTML. It recommends separating code into controllers and views by gathering all code, separating controller and view code, assigning variables to a view object, changing variable references in the view code, and splitting the files. Specific problems in legacy PHP code like no separation of concerns, global variables, and reliance on includes can be addressed through techniques like creating view classes, encapsulating logic in objects, and wrapping includes in functions to untangle dependency webs. The goal is to safely change code implementation without changing behavior through refactoring.
Caching is one of the most popular ways to optimize the performance of web applications. Magento is not far from this trend and the primary approach to speed up slow code from the core team is to cache it. This approach works well for small projects where the rate of inventory changes is shallow. But as soon as you enter sales season or receive regular product updates from the external system, your cache hit ratio plummets. In this talk, you will learn how to ensure that your system’s uncached response times are as light as possible when you get a cache miss by minimizing the I/O of your application with intelligent batch data preloading.
Web2py tutorial to create db driven application.fRui Apps
This document summarizes how to create a simple database driven application using the web2py python framework. It outlines downloading and running web2py, creating an application, modeling the database with a 'notes' table with various fields, and defining functions to handle CRUD operations like indexing all notes, creating a new note, and editing a note. Templates are also created to display the notes index and create/edit forms. The full source code is provided.
This document discusses the history and evolution of Rails form handling capabilities from Rails 1.0 through 2.0. Early versions used basic form_tag and text_field helpers that treated forms like hashes. Rails 1.1 introduced form_for to associate forms with model objects. Rails 2.0 integrated this with resource-based routes and conventions for form IDs and classes based on the model. Throughout, Rails aimed to bridge the gap between forms, controllers, models and the database in a seamless, object-oriented way.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
DrupalJam 2018 - Maintaining a Drupal Module: Keep It Small and SimpleAlexander Varwijk
This document discusses maintaining a Drupal module called Real-Time SEO. It provides background on the module, how it was originally built and maintained, and improvements made in recent versions. The key points are:
- Real-Time SEO analyzes content to provide SEO feedback and was originally built in collaboration with Yoast, but is now maintained by GoalGorilla.
- Version 1 only supported node content and a few fields. Recent updates added support for things like paragraphs and embedded media.
- The updates involved rendering content on the server and passing it to the Yoast analysis library, rather than just analyzing individual fields.
- A better approach is to use standard Drupal form and
This document discusses strategies for dealing with legacy PHP code, including separating controllers and views, removing dependencies on global variables, refactoring procedural code to be object-oriented, and untangling nested require statements. Specific problems in legacy PHP code are said to include mixing of PHP and HTML, overuse of requires instead of method calls, and excessive use of global variables. The document provides examples of refactoring code to address these issues.
The document discusses refactoring legacy PHP code, specifically dealing with code that has no separation between PHP and HTML. It recommends separating code into controllers and views by gathering all code, separating controller and view code, assigning variables to a view object, changing variable references in the view code, and splitting the files. Specific problems in legacy PHP code like no separation of concerns, global variables, and reliance on includes can be addressed through techniques like creating view classes, encapsulating logic in objects, and wrapping includes in functions to untangle dependency webs. The goal is to safely change code implementation without changing behavior through refactoring.
Caching is one of the most popular ways to optimize the performance of web applications. Magento is not far from this trend and the primary approach to speed up slow code from the core team is to cache it. This approach works well for small projects where the rate of inventory changes is shallow. But as soon as you enter sales season or receive regular product updates from the external system, your cache hit ratio plummets. In this talk, you will learn how to ensure that your system’s uncached response times are as light as possible when you get a cache miss by minimizing the I/O of your application with intelligent batch data preloading.
Web2py tutorial to create db driven application.fRui Apps
This document summarizes how to create a simple database driven application using the web2py python framework. It outlines downloading and running web2py, creating an application, modeling the database with a 'notes' table with various fields, and defining functions to handle CRUD operations like indexing all notes, creating a new note, and editing a note. Templates are also created to display the notes index and create/edit forms. The full source code is provided.
The document provides an overview of using the Drupal database API for interacting with the Drupal database. It covers basics of db_query and dynamic queries using db_select. Key points include using placeholders in queries, working with result sets, and more advanced topics like joins, sorting, conditional statements, and query tagging. The document suggests considering the database API as an alternative to Views when custom queries or aggregated data are needed that may require complex Views configuration.
https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes - origin
Laravel 5.1 raised the bar for framework documentation, but there's much, much more lurking beneath the surface. In this 50-minute session, we'll explore 50 (yes, 50!) high-leverage implementation tips & tricks that you just won't find in the docs: the IoC Container, Blade, Eloquent, Middleware, Routing, Commands, Queues, Events, Caching — we'll cover them all! Join us as we drink from the fire hose & learn to take advantage of everything that Laravel has to offer to build better software faster!
Ruby on Rails is a web application framework that allows for quick development of database-backed web applications. It emphasizes conventions over configuration for high programmer productivity. Some key features include MVC architecture, active record pattern for ORM, and convention-based routing. The framework is powered by the Ruby programming language which provides dynamic features like blocks, callbacks, and metaprogramming that enhance developer happiness. However, Rails does have some limitations around internationalization, speed, stability with legacy systems, and lack of resources in some regions like Taiwan.
The document describes software design patterns called specifications. Specifications encapsulate business rules and can be used for validation (assertions), selection of objects, and building objects step-by-step (build to order). Specifications define an interface to check if a rule is satisfied and can be combined using composite patterns like AND, OR and NOT. They make business rules explicit, testable and reusable in code. Examples show how specifications can be used to validate objects, build product baskets, and filter query results.
Valeriy Rabievskiy leads a web studio called stfalcon.com and is an active open source developer. Doctrine 2 is separated into common, DBAL, ORM, and migrations libraries. Entities are lightweight PHP classes that store data in object properties without needing to extend a base class. The EntityManager acts as the central access point for ORM functions like updating entities and accessing repositories. ZF2 integrates with Doctrine 2 through autoloading. The console provides commands for tasks like validating the schema, generating proxies, and running migrations to update the database schema.
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
This document discusses building web services using the Zend Framework. It introduces key components for building SOAP, XML-RPC, and RESTful services, including the Zend_Soap, Zend_XmlRpc, and Zend_Rest libraries. It provides an example of building a timesheet API and exposing it through different protocols, demonstrating how to define methods, handle requests and responses, and implement clients. Documentation of the API using docblocks is also covered.
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
The goal of this talk is to educate developers on common security vulnerabilities, how they are exploited, and how to protect against them. We'll explore several of the OWASP Top 10 attack vectors like SQL injection, XSS, CSRF, session hijacking, and insecure direct object references. Each topic will be approached from the perspective of an attacker to see how these vulnerabilities are detected and exploited using several realistic examples. Once we've established an understanding of how these attacks work, we'll look at concrete steps you can take to secure web applications against such vulnerabilities. The knowledge gained from this talk can also be used for participating in "Capture the Flag" security competitions.
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
Dig deeper into WordPress is a presentation made for Web Designers Meetup in Cairo taken place on 17th Dec 2012.
Signup at WPMonkeys.com to get notified when awesome new WordPress related content is published.
"Dependency injection" (DI) seems like one of those hot buzzwords that will solve all your problems. But what is DI really? How does it help keep code clean and maintainable? And how do you take a legacy codebase and rewrite it to take advantage of DI? This talk takes an application written without DI and walks through the steps for "injecting" DI into the code. Learn the difference between "dependency injection" and "dependency injection containers". See how DI makes things like event-driven architectures simple to implement. And learn how DI leads to code that is easier to debug and test.
Ruby on Rails is a web application framework that is designed to make programming web applications easier. It uses conventions over configurations and includes features like ActiveRecord for object-relational mapping, ActionPack for building web applications, and ActionView for rendering views. Rails emphasizes convention over configuration and aims to provide a full stack framework that makes it easy to build database-backed web applications by following its conventions.
Les Web Components inaugurent une nouvelle ère de développement web, un monde dans lequel vous prenez le pouvoir avec la possibilité de créer de nouveaux composants personnalisés et encapsulables. Construit sur ces nouveaux standards, Polymer facilite l'implémentation de composants du simple bouton à une application riche complète.
Nous verrons dans cette présentation les différentes spécifications mises en oeuvre derrière le concept de WebComponents (Shadow Dom, Custom Element ...) ainsi que leur mise en place en utilisant Polymer
This document provides an overview of Python fundamentals including installing Python, hidden documentation tools, data types, strings, lists, tuples, dictionaries, control flow statements, functions, classes, the datetime library, importing modules, and web2py fundamentals such as the request and response objects, templates, controllers, models, and more. Key concepts covered include Python types like strings, lists, tuples and dictionaries, control structures like if/else and for loops, functions, classes and objects, and the basics of using the web2py framework to build web applications.
This document summarizes the Zend Framework form creation and handling capabilities. It describes how to create basic forms with elements like text, checkbox, radio etc. and configure elements with decorators, filters, validators. It also covers customizing forms by creating custom elements, decorators, filters and validators by extending base classes.
This document provides an overview of Apache iBatis, an object-relational mapping tool for Java. It discusses why iBatis was created as a lighter-weight alternative to full-featured ORM solutions. The document then covers the basic steps to use iBatis, including writing Java objects, mapping configurations, database configurations, and application code. It also discusses key iBatis concepts like parameterized queries, result mappings, and using primitive types, beans, maps, or inline parameters.
The document discusses WooCommerce CRUD (Create, Read, Update, Delete) and data stores. It explains that CRUD objects allow developers to interact with WooCommerce resource types like orders, products, and customers in a standardized way without needing to know the underlying data storage details. Data stores provide an abstraction layer between CRUD objects and the actual data storage, which could be custom post types, custom tables, external services, or other options. The document provides examples of how CRUD objects and data stores work in WooCommerce, and guidance for developers creating custom CRUD functionality in extensions.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
Hibernate working with criteria- Basic IntroductionEr. Gaurav Kumar
This document provides an introduction to using the Hibernate Criteria API for building query objects programmatically. It demonstrates how to create a Criteria object from a Session, add restrictions and conditions, combine restrictions with logical operators, sort results, and perform aggregate functions and projections. The main advantage of the Criteria API over HQL is that it provides a cleaner, more object-oriented and type-safe approach to querying compared to plain HQL.
The WordPress Accessibility Team presented at the 29th International Technology and Persons With Disabilities conference on March 20, 2014. This deck lists what we are doing, our responsibilities, how you can get started helping, and progress in the Cities project.
The document provides an overview of using the Drupal database API for interacting with the Drupal database. It covers basics of db_query and dynamic queries using db_select. Key points include using placeholders in queries, working with result sets, and more advanced topics like joins, sorting, conditional statements, and query tagging. The document suggests considering the database API as an alternative to Views when custom queries or aggregated data are needed that may require complex Views configuration.
https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes - origin
Laravel 5.1 raised the bar for framework documentation, but there's much, much more lurking beneath the surface. In this 50-minute session, we'll explore 50 (yes, 50!) high-leverage implementation tips & tricks that you just won't find in the docs: the IoC Container, Blade, Eloquent, Middleware, Routing, Commands, Queues, Events, Caching — we'll cover them all! Join us as we drink from the fire hose & learn to take advantage of everything that Laravel has to offer to build better software faster!
Ruby on Rails is a web application framework that allows for quick development of database-backed web applications. It emphasizes conventions over configuration for high programmer productivity. Some key features include MVC architecture, active record pattern for ORM, and convention-based routing. The framework is powered by the Ruby programming language which provides dynamic features like blocks, callbacks, and metaprogramming that enhance developer happiness. However, Rails does have some limitations around internationalization, speed, stability with legacy systems, and lack of resources in some regions like Taiwan.
The document describes software design patterns called specifications. Specifications encapsulate business rules and can be used for validation (assertions), selection of objects, and building objects step-by-step (build to order). Specifications define an interface to check if a rule is satisfied and can be combined using composite patterns like AND, OR and NOT. They make business rules explicit, testable and reusable in code. Examples show how specifications can be used to validate objects, build product baskets, and filter query results.
Valeriy Rabievskiy leads a web studio called stfalcon.com and is an active open source developer. Doctrine 2 is separated into common, DBAL, ORM, and migrations libraries. Entities are lightweight PHP classes that store data in object properties without needing to extend a base class. The EntityManager acts as the central access point for ORM functions like updating entities and accessing repositories. ZF2 integrates with Doctrine 2 through autoloading. The console provides commands for tasks like validating the schema, generating proxies, and running migrations to update the database schema.
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
This document discusses building web services using the Zend Framework. It introduces key components for building SOAP, XML-RPC, and RESTful services, including the Zend_Soap, Zend_XmlRpc, and Zend_Rest libraries. It provides an example of building a timesheet API and exposing it through different protocols, demonstrating how to define methods, handle requests and responses, and implement clients. Documentation of the API using docblocks is also covered.
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
The goal of this talk is to educate developers on common security vulnerabilities, how they are exploited, and how to protect against them. We'll explore several of the OWASP Top 10 attack vectors like SQL injection, XSS, CSRF, session hijacking, and insecure direct object references. Each topic will be approached from the perspective of an attacker to see how these vulnerabilities are detected and exploited using several realistic examples. Once we've established an understanding of how these attacks work, we'll look at concrete steps you can take to secure web applications against such vulnerabilities. The knowledge gained from this talk can also be used for participating in "Capture the Flag" security competitions.
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
Dig deeper into WordPress is a presentation made for Web Designers Meetup in Cairo taken place on 17th Dec 2012.
Signup at WPMonkeys.com to get notified when awesome new WordPress related content is published.
"Dependency injection" (DI) seems like one of those hot buzzwords that will solve all your problems. But what is DI really? How does it help keep code clean and maintainable? And how do you take a legacy codebase and rewrite it to take advantage of DI? This talk takes an application written without DI and walks through the steps for "injecting" DI into the code. Learn the difference between "dependency injection" and "dependency injection containers". See how DI makes things like event-driven architectures simple to implement. And learn how DI leads to code that is easier to debug and test.
Ruby on Rails is a web application framework that is designed to make programming web applications easier. It uses conventions over configurations and includes features like ActiveRecord for object-relational mapping, ActionPack for building web applications, and ActionView for rendering views. Rails emphasizes convention over configuration and aims to provide a full stack framework that makes it easy to build database-backed web applications by following its conventions.
Les Web Components inaugurent une nouvelle ère de développement web, un monde dans lequel vous prenez le pouvoir avec la possibilité de créer de nouveaux composants personnalisés et encapsulables. Construit sur ces nouveaux standards, Polymer facilite l'implémentation de composants du simple bouton à une application riche complète.
Nous verrons dans cette présentation les différentes spécifications mises en oeuvre derrière le concept de WebComponents (Shadow Dom, Custom Element ...) ainsi que leur mise en place en utilisant Polymer
This document provides an overview of Python fundamentals including installing Python, hidden documentation tools, data types, strings, lists, tuples, dictionaries, control flow statements, functions, classes, the datetime library, importing modules, and web2py fundamentals such as the request and response objects, templates, controllers, models, and more. Key concepts covered include Python types like strings, lists, tuples and dictionaries, control structures like if/else and for loops, functions, classes and objects, and the basics of using the web2py framework to build web applications.
This document summarizes the Zend Framework form creation and handling capabilities. It describes how to create basic forms with elements like text, checkbox, radio etc. and configure elements with decorators, filters, validators. It also covers customizing forms by creating custom elements, decorators, filters and validators by extending base classes.
This document provides an overview of Apache iBatis, an object-relational mapping tool for Java. It discusses why iBatis was created as a lighter-weight alternative to full-featured ORM solutions. The document then covers the basic steps to use iBatis, including writing Java objects, mapping configurations, database configurations, and application code. It also discusses key iBatis concepts like parameterized queries, result mappings, and using primitive types, beans, maps, or inline parameters.
The document discusses WooCommerce CRUD (Create, Read, Update, Delete) and data stores. It explains that CRUD objects allow developers to interact with WooCommerce resource types like orders, products, and customers in a standardized way without needing to know the underlying data storage details. Data stores provide an abstraction layer between CRUD objects and the actual data storage, which could be custom post types, custom tables, external services, or other options. The document provides examples of how CRUD objects and data stores work in WooCommerce, and guidance for developers creating custom CRUD functionality in extensions.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
Hibernate working with criteria- Basic IntroductionEr. Gaurav Kumar
This document provides an introduction to using the Hibernate Criteria API for building query objects programmatically. It demonstrates how to create a Criteria object from a Session, add restrictions and conditions, combine restrictions with logical operators, sort results, and perform aggregate functions and projections. The main advantage of the Criteria API over HQL is that it provides a cleaner, more object-oriented and type-safe approach to querying compared to plain HQL.
The WordPress Accessibility Team presented at the 29th International Technology and Persons With Disabilities conference on March 20, 2014. This deck lists what we are doing, our responsibilities, how you can get started helping, and progress in the Cities project.
First, the narrator wakes up at 8 am, watches TV, wakes and feeds her son, and gets them both dressed and eats breakfast. She then takes her son to the nanny's house and goes to school, where she has back-to-back classes until 1:40 pm. After studying in the library, she leaves school and picks up her son from the nanny. On the drive home, she listens to soft music until arriving home. There, she makes dinner, feeds her son and herself, and does homework while getting things ready for the next day. Later, she bathes herself and her son, reads him a book, watches TV with him, and they are both asleep by 9 pm.
This document provides an overview and analysis of the US housing market in April 2009. It summarizes key housing statistics such as home sales increasing 5.1% in February, the median home price falling to $165,400, and inventory levels declining to a 9.7 month supply. The document also notes mortgage rates are at historic lows around 5% due to government actions, but rates may rise again due to inflation concerns. Overall, the housing market shows signs of improving from the worst conditions in years.
This document summarizes key information from a monthly real estate research report. It discusses recent improvements in the housing market including rising home sales, falling home prices and inventory levels, and historically low mortgage rates. It also outlines recent government efforts to stimulate the housing market such as programs to purchase toxic assets from banks and expand mortgage-backed security purchases. Finally, it provides research and tips for both home buyers and sellers.
The document summarizes recent real estate news and data from March 2009. It provides commentary on the new homebuyer tax credit and mortgage assistance programs from the economic stimulus package. Data shows home sales and prices fell in January while affordability and inventory increased. The unemployment rate rose to 8.1% and GDP declined 6% in Q4 2008. Recent government actions outlined include the stimulus package provisions and a new plan to help homeowners refinance or modify loans to avoid foreclosure.
Organizher is introducing a line of functional and fashionable planners, notebooks, organizers and accessories for modern households. The products are designed to help users juggle multiple schedules and tasks. Over 20 new items will be introduced, including notebooks, calendars, planners, dry erase boards and organizers. Many feature guided pages, storage pockets and accessories to help families and individuals stay organized.
Dokumen tersebut membahas tentang normalisasi database dan perancangan program. Secara ringkas, dibahas mengenai tahapan normalisasi dari 1NF hingga 5NF beserta jenis-jenis kunci pada normalisasi, parameter spesifikasi file seperti tipe, organisasi, dan media file, serta ciri 1NF dan 2NF. Selanjutnya dibahas mengenai tujuan membuat spesifikasi proses, simbol pada bagan terstruktur, pengertian pseudocode, bagan ut
Duo is an event marketing, promotions, design and production company based in San Juan, Puerto Rico. They create memorable brand experiences through strategic planning, innovative ideas, and high-quality event execution. Their team has over 30 years of combined experience in public relations, promotions, and event production. Duo focuses on winning consumers' hearts and minds through emotional branding, innovative experiences, and perfect execution. They provide a wide range of services including promotions, graphic design, video production, social media strategies, and event marketing for concerts, parties, and other live experiences. Duo has worked with many well-known brands across industries.
This document discusses the role of postpartum support groups in identifying and addressing risk factors for postpartum mood disorders. It provides evidence that support groups can help reduce depressive symptoms in new mothers. The document outlines many potential risk factors for postpartum depression, including difficult births, lack of social support, breastfeeding issues, marital problems, and prior mental health conditions or abuse. It emphasizes the importance of integrating psychiatric support into obstetric care to help break cycles of mood disorders experienced during pregnancy and motherhood.
Site owners are looking for accessible WordPress themes. There is a spectacular lack of accessible WordPress themes. A world-wide group of accessibility practitioners are creating free accessible WordPress themes.
This is a presentation of Educational Games.It has spicific components of Educational games and definition.It has uses in education ans examples from internet.
Kate McNair is a certified holistic health coach, creative catalyst, artist and designer who holds a B.Des. and C.H.C. She encourages living your art and viewing your life as a masterpiece.
This is a presentation a bout Educational Games.It has difinition and spicific components of educational games.Alsi it has uses in education and some examples of it.
PHP frameworks provide reusable code and standardized structures for developing applications. The Zend framework is a popular open source PHP MVC framework that offers features like database abstraction, forms, validation, routing and more. It provides a modular architecture that allows applications to scale easily while maintaining code quality and organization.
This document provides an introduction and overview of DBIx::Class, an ORM (object relational mapper) for Perl. It discusses setting up tables for an authors and books example database, and performing CRUD (create, read, update, delete) operations both manually using SQL and using DBIx::Class. It also covers creating models with Schema::Loader, debugging, overloading result and result set classes, and inflating/deflating columns.
Agile Data is a PHP library that provides an object-oriented framework for business logic and data modeling. It includes features like query builders, data sets, active record implementation, and support for SQL and NoSQL databases. Models can define fields, conditions, expressions, and relationships. Datasets allow restricting and aggregating records. The library aims to make business logic expressive and database independent through an extensible architecture.
Using Geeklog as a Web Application FrameworkDirk Haun
Slides for the workshop "Using Geeklog as a Web Application Framework", as held at
- LinuxTag 2006, Wiesbaden, Germany, 2006-05-06
- PHP user group meeting, Stuttgart, Germany, 2006-05-10
- FrOSCon, Bonn, Germany, 2006-06-24
This document describes implementing a two-step view concept in CodeIgniter by using output buffering. It involves three main components: 1) an initialization hook to start output buffering, 2) a helper to generate the two-step view content and load it into a layout view, and 3) a layout view to echo the content. The helper gets the buffered content, loads a view to generate the content string, loads the layout view and passes the content, and the layout view echoes the content within the HTML structure. This allows separating view generation and rendering for a cleaner separation of logic and presentation.
Abstracting functionality with centralised contentMichael Peacock
Centralised content involves storing all content types (pages, blog posts, products, etc.) in a centralised database structure for easier management. This allows content to be treated similarly while still supporting type-specific fields. The document discusses implementing centralised content with PHP and MySQL using a model-view-controller approach. Core content fields are stored in one table, with type-specific fields stored in linked tables. This allows new content types to be added without changing existing code.
This document summarizes changes to the Drupal 7 API, including improvements to the database, translation, rendering, queue, and file APIs. Key changes include an object-oriented database API, support for localization servers, storing page content as render arrays, adding producer/worker queues to offload long tasks from cron, and a stream-based file API. Modules can now more easily alter queries and page output, and additional queue and file stream types can be defined.
The document discusses CodeIgniter, an open source PHP MVC framework, and provides information about CodeIgniter features such as controllers, models, views, helpers, libraries, and working with databases using CodeIgniter's active record functions. It also covers topics like installing CodeIgniter, creating controllers and models, and loading views, helpers, and libraries.
This document discusses database queries for a social media application called MySocial. It describes several functions in the database_queries.php file that query the database to retrieve and insert user data. These include functions to get a user's username, add a post for a user, and get all posts for a user. The functions follow an MVC pattern, with the model layer querying the database, controller processing submitted data, and views outputting the data.
This document discusses how database queries are used in a social media application called MySocial to retrieve and store user data. It provides examples of functions in the database_queries.php file that query the database to get a username, add a user post, and get all posts for a user. These functions are called from the controller and views to retrieve and display the necessary data to the user. The database stores tables like users and posts that are queried to integrate user information and content into the web application.
The document provides an overview of the Doctrine NoSQL project. It discusses how Doctrine provides object document mappers for NoSQL databases like MongoDB, CouchDB, and PHPCR to allow working with documents as objects. It describes the common persistence interfaces, mapping capabilities like associations and embedded objects, and how basic CRUD operations work. It also highlights benefits of NoSQL databases like schemaless storage and how Doctrine supports features of specific databases like views, attachments, and geospatial queries.
Dapper is an object mapper for ADO.NET that aims to simplify data access and mapping between .NET objects and SQL databases. It provides extension methods for querying and mapping database results to .NET objects with minimal code. Micro ORMs like Dapper, Massive, PetaPoco, and SimpleData aim to simplify data access without requiring complex infrastructure or configuration. They emphasize performance, simplicity and working directly with SQL and database objects.
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
blog_db_interface.php
<?php
include_once('blog_exceptions.php');
class class_DB_Interface {
/********************************************************
*
* Data definitions. Per instantiation
*
* Implementatiion details ae hidden from the user
* This is the definition of encapsulation
*
********************************************************/
private $referer;
function __construct() {
$referer = $_SERVER['HTTP_REFERER'];
echo '<p><a href="'. $referer .'" title="Return to the previous page">« Go back</a></p>';
}
function __destruct(){
}
public function blogPostsSummary()
{
$db = @new mysqli('localhost', 'blogdb_user', 'blogdb_userPW', 'blogdbx');
if (mysqli_connect_errno()) {
throw new MySQLI_Exception(" Unable to connect to MYSQL server ", mysqli_connect_errno());
}
// Create a join to pull information from the database
$query = "SELECT blogdb.users.Blogger_Name,".
" blogdb.post.Post_Summary".
" from blogdb.users".
" inner join blogdb.post".
" on blogdb.users.idUser = blogdb.post.User_idUser1";
$stmt = $db->prepare($query);
$stmt->execute();
$stmt->bind_result($bname, $summary);
//echo "<br/>Blogs Summary</p>";
while($stmt->fetch()) {
echo $bname." ".$summary."</p>";
}
$stmt->free_result();
$db->close();
}
public function allBloggers()
{
$db = @new mysqli('localhost', 'blogdb_user', 'blogdb_userPW', 'blogdb');
if (mysqli_connect_errno()) {
throw new MySQLI_Exception();
}
// Create a simple query to pull all blogger names from the DB
return;
}
public function blogPostsByBlogger($bname)
{
$db = @new mysqli('localhost', 'blogdb_user', 'blogdb_userPW', 'blogdb');
if (mysqli_connect_errno()) {
throw new MySQLI_Exception();
}
$query = "SELECT blogdb.users.Blogger_Name,".
" blogdb.post.Post_Summary".
" from blogdb.users".
" inner join blogdb.post".
" on blogdb.users.idUser = blogdb.post.User_idUser1".
" and blogdb.users.Blogger_Name = ?";
$stmt = $db->prepare($query);
$stmt->bind_param('s', $bname);
$stmt->execute();
$stmt->bind_result($blogger_name, $bsummary);
// Pull the result into the PHP runtime. copies result data allowing memory to be freed in the
// MYSQL runtime environment
$stmt->store_result(); // Note: $STMT::num_rows is zero without first calling this API
$numBlogs = 0;
echo "<br />Blogs for : ".$bname."</p>";
while($stmt->fetch()) {
echo $bsummary."</p>";
$numBlogs++;
}
$stmt->free_result();
$db->close();
}
public function insertBlog($bloggerName, $blogSummary, $blogContent)
{
$db = @new mysqli('localhost', 'blogdb_user', 'blogdb_user ...
LINQ to SQL allows accessing local SQLite databases on Windows Phone. It supports queries, inserts, updates and deletes through a data context. The database schema can be upgraded by adding or removing tables and columns. Performance best practices include keeping change sets small and submitting changes frequently to avoid data loss.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Dive into the realm of operating systems (OS) with Pravash Chandra Das, a seasoned Digital Forensic Analyst, as your guide. 🚀 This comprehensive presentation illuminates the core concepts, types, and evolution of OS, essential for understanding modern computing landscapes.
Beginning with the foundational definition, Das clarifies the pivotal role of OS as system software orchestrating hardware resources, software applications, and user interactions. Through succinct descriptions, he delineates the diverse types of OS, from single-user, single-task environments like early MS-DOS iterations, to multi-user, multi-tasking systems exemplified by modern Linux distributions.
Crucial components like the kernel and shell are dissected, highlighting their indispensable functions in resource management and user interface interaction. Das elucidates how the kernel acts as the central nervous system, orchestrating process scheduling, memory allocation, and device management. Meanwhile, the shell serves as the gateway for user commands, bridging the gap between human input and machine execution. 💻
The narrative then shifts to a captivating exploration of prominent desktop OSs, Windows, macOS, and Linux. Windows, with its globally ubiquitous presence and user-friendly interface, emerges as a cornerstone in personal computing history. macOS, lauded for its sleek design and seamless integration with Apple's ecosystem, stands as a beacon of stability and creativity. Linux, an open-source marvel, offers unparalleled flexibility and security, revolutionizing the computing landscape. 🖥️
Moving to the realm of mobile devices, Das unravels the dominance of Android and iOS. Android's open-source ethos fosters a vibrant ecosystem of customization and innovation, while iOS boasts a seamless user experience and robust security infrastructure. Meanwhile, discontinued platforms like Symbian and Palm OS evoke nostalgia for their pioneering roles in the smartphone revolution.
The journey concludes with a reflection on the ever-evolving landscape of OS, underscored by the emergence of real-time operating systems (RTOS) and the persistent quest for innovation and efficiency. As technology continues to shape our world, understanding the foundations and evolution of operating systems remains paramount. Join Pravash Chandra Das on this illuminating journey through the heart of computing. 🌟
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Trusted Execution Environment for Decentralized Process MiningLucaBarbaro3
Presentation of the paper "Trusted Execution Environment for Decentralized Process Mining" given during the CAiSE 2024 Conference in Cyprus on June 7, 2024.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
2. Rapid Prototyping with PEAR
The principles of Rapid Prototyping
Show results to the customer quickly
Discuss neccessary changes early
Refine the prototype until customer is
happy with the application
Either refactor until a clean codebase is
reached or reprogram cleanly based on the
approved prototype's features
3. Rapid Prototyping with PEAR
The PEAR packages that aid us
DB (database API abstraction layer)
DB_DataObject (object-relational
mapping)
HTML_QuickForm (building and validating
of HTML forms)
DB_DataObject_FormBuilder (auto-
generates forms from DataObjects)
4. The concept
What must my application do?
What kind of data entities do I need?
How are the entities related?
GOAL: Reach an object-oriented
approach to the data – think of every
data entity as a class
5. Example: Bookstore application
What it must do:
Store book data (titles, authors, formats)
Store customer data (name, adress)
Store customer reviews (did it suck?)
6. Bookstore data entities
...this translates to the following entities:
Book, Format, Customer, Review
Rule of thumb:
If one entity has a property that can have
more than two values, make this another
entity (especially if values can change)!
Your database models should always be
properly normalized.
7. Use an ERD tool
Better understanding of relations
between entities
Changes can be done quickly
Database is always documented
DBMS independence (depending on the
tool)
8. The entity relationship model
Keep naming scheme consistent
wherever possible
Use pl. txt fld & tbl names, av. abbr.!
9. Introducing DataObject
PEAR::DB_DataObject...
maps database tables to PHP classes
provides easy access to common SQL
functions like select, insert, update, delete...
allows developers with weak knowledge of
SQL to write database-aware code
encourages clean distinction between
presentation and business logic
10. Configuring DataObject
Uses one simple .ini file:
[DB_DataObject]
database = mysql://user:pw@localhost/demo
schema_location = /dataobjects/schema/
class_location = /dataobjects/
require_prefix = /dataobjects/
extends_location = DB/DataObject.php
extends = DB_DataObject
...or, you can use plain PHP arrays.
11. Creating classes from tables...
$> createTables.php /path/to/DataObject.ini
...creates five files:
Format.php, Book.php, Review.php,
Customer.php, demo.ini
13. Generated sourcecode
<?php
/**
* Table Definition for format
*/
require_once 'DB/DataObject.php';
class Format extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
var $__table = 'format'; // table name
var $format_id; // int(4) not_null primary_key unique_key
unsigned auto_increment
var $title; // string(40)
/* ZE2 compatibility trick*/
function __clone() { return $this;}
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Format',$k,$v);
}
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
?>
14. Generated database file
DO puts the database model into simple
config file named „demo.ini“
[book]
book_id = 129
title = 130
description = 66
isbn = 130
format_id = 129
[book__keys]
book_id = N
[customer]
customer_id = 129
name = 130
street = 2
zip = 2
city = 2
[customer__keys]
customer_id = N
[format]
format_id = 129
title = 2
...
15. Working with DataObjects (1)
How to get a book record by primary key:
<?php
require_once('DB/DataObject.php');
require('config.php');
$book = DB_DataObject::factory('book');
$book->get(42);
echo 'This book is called: '.$book->title;
?>
16. Working with DataObjects (2)
Getting all books having a specific
format:
$book = DB_DataObject::factory('book');
$book->format_id=23;
$num = $book->find();
$i = 1;
while ($book->fetch()) {
echo quot;Book: $i of $num: {$book->title}<br>quot;;
$i++;
}
17. Working with DataObjects (3)
Adding your own WHERE clauses:
$book = DB_DataObject::factory('book');
$book->whereAdd(quot;book.title LIKE 'PHP%'quot;);
$num = $book->find();
$i = 1;
while ($book->fetch()) {
echo quot;Book: $i of $num: {$book->title}<br>quot;;
$i++;
}
19. Working with DataObjects (5)
Set up table relations using another
config file: demo.links.ini
[book]
format_id = format:format_id
[review]
book_id = book:book_id
customer_id = customer:customer_id
20. Working with DataObjects (6)
After setting up relationships, you can
join table objects:
$review = DB_DataObject::factory('review');
$customer = DB_DataObject::factory('customer');
$review->book_id=4711;
$review->joinAdd($customer, 'INNER');
$review->selectAdd('customer.name');
$review->find();
while ($review->fetch()) {
echo $review->title.' (a review by '.
$review->name.')<br>';
echo $review->description.'<hr>';
}
21. Working with DataObjects (7)
Emulating triggers, encapsulating
business logic, embracing inheritance:
function delete()
{
if ($GLOBALS['user']->checkRight(MAY_DELETE_HERE)) {
$this->cleanUpStuff();
return parent::delete();
}
return false;
}
22. Working with DataObjects (8)
Overloading
Automatic set/get methods
Breaks pass-by-reference in PHP4
Recommend not to use in PHP4
<?php
define('DB_DATAOBJECT_NO_OVERLOAD', 1);
require_once('DB/DataObject.php');
23. Adding forms – the simple way
DB_DataObject_FormBuilder...
...creates forms from DataObjects
...allows configuring form generation
through setting reserved properties in
DataObjects
...triggers callback methods for further form
manipulation
...handles form processing and
inserting/updating data in the database
24. Creating a form for a review
require_once('DB/DataObject/FormBuilder.php');
require('config.php');
$review = DB_DataObject::factory('review');
$builder =& DB_DataObject_FormBuilder::create($review);
$form =& $builder->getForm();
if ($form->validate()) {
$form->process(array(&$builder,'processForm'),
false);
echo 'New review ID: '.$review->review_id;
}
echo $form->toHtml();
26. Using the form to update data
require_once('DB/DataObject.php');
require_once('DB/DataObject/FormBuilder.php');
require('config.php');
$review = DB_DataObject::factory('review');
$review->get(13);
$builder =& DB_DataObject_FormBuilder::create($review);
$form =& $builder->getForm();
if ($form->validate()) {
$form->process(array(&$builder,'processForm'),
false);
echo 'Review updated!';
}
echo $form->toHtml();
27. Configuring FormBuilder
Add some lines to DataObject.ini:
[DB_DataObject_FormBuilder]
linkDisplayFields = title
Add one line to the config include file:
$_DB_DATAOBJECT_FORMBUILDER['CONFIG'] =
$config['DB_DataObject_FormBuilder'];
28. The new form output
Customer still not displayed... no „title“!
29. Tweaking the customer class
class Customer extends DB_DataObject
{
###START_AUTOCODE
/* some code omitted */
###END_AUTOCODE
// Use the 'name' property to display records
// whenever this class is used as the source for
// a select box!
// Overrides the default in the ini file.
var $fb_linkDisplayFields = array('name');
}
31. Tweaking the form (labels)
To define custom labels, use the
'fieldLabels' property:
class Customer extends DB_DataObject
{
###START_AUTOCODE
/* some code omitted */
###END_AUTOCODE
var $fb_fieldLabels = array(
'customer_id' => 'Customer',
'book_id' => 'Book');
}
33. Tweaking the form (elements)
Defining textareas... the old-fashioned
way:
class Customer extends DB_DataObject
{
###START_AUTOCODE
/* some code omitted */
###END_AUTOCODE
var $fb_textFields = array('review');
}
35. Tweaking the form (elements)
Use the preGenerateForm() callback
method and 'preDefElements' property to
define your own element types for
specific fields:
function preGenerateForm(&$fb) {
$el = HTML_QuickForm::createElement('hidden',
'customer_id');
$this->fb_preDefElements['customer_id'] = $el;
}
37. Tweaking the form (rules)
Use the postGenerateForm() callback
method to add form validation rules and
input filters:
function postGenerateForm(&$form) {
$form->addRule('title', 'Please enter a title',
'required');
$form->addRule('review', 'Please at least try...',
'minlength', 10);
$form->applyFilter('__ALL__', 'trim');
}
39. Defining custom forms
You can make your own forms if...
...the form requires more than just
„tweaking“
...you want better model / view separation
Just define your own getForm() method
pre- and postGenerateForm() will still be
triggered!
FormBuilder can still process the input
40. Defining custom forms
class CustomerForm extends HTML_QuickForm {
function CustomerForm($formName='CustomerForm',
$method='post', $action='',
$target='_self', $attributes=null) {
parent::HTML_QuickForm($formName, $method, $action,
$target, $attributes);
$this->addElement('text', 'name', 'Customer name');
$this->addElement('text', 'street','Street');
$this->addElement('text', 'zip', 'ZIP');
$this->addElement('text', 'city', 'City');
$this->addElement('submit', 'submit', 'Submit');
$this->addRule('name', 'Please enter a name',
'required');
$this->applyFilter('__ALL__', 'trim');
}
}
41. Defining custom forms
class Customer extends DB_DataObject
{
function &getForm($action=false, $target='_self',
$formName='CustomerForm', $method='post')
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
include_once('forms/CustomerForm.php');
$form =& new CustomerForm($formName, $method, $action,
$target);
return $form;
}
}
42. But...
FormBuilder has lots of
options. Check the
documentation and ask
questions before resorting to
your own form
43. Processing the form
Usually done automatically:
$form->process(array(&$builder,'processForm'),
false);
You can also force a specific data
handling method:
$builder->forceQueryType(
DB_DATAOBJECT_FORMBUILDER_QUERY_FORCEINSERT
);
44. Processing the form
Callback methods available:
preProcessForm()
postProcessForm()
Common uses:
Event notification
Generating changelogs (before / after)
45. Nested forms
To make just one form for data from two
different tables:
$review = DB_DataObject::factory('review');
$customer = DB_DataObject::factory('customer');
$customer->createSubmit = false;
$reviewBuilder =&
DB_DataObject_FormBuilder::create($review);
$customerBuilder =&
DB_DataObject_FormBuilder::create($customer);
$customerBuilder->elementNamePrefix = 'customer';
$customerForm =& $customerBuilder->getForm();
$reviewBuilder->elementNamePrefix = 'review';
$reviewBuilder->useForm($customerForm);
$combinedForm =& $reviewBuilder->getForm();
47. FormBuilder Evolves...
Features released since this talk:
Support for crosslink tables (m:n)
Support for custom elements as global
replacements for standard ones:
elementTypeMap =
date:jscalendar,longtext:htmlarea
Many others!
48. Application template
// FILE: index.php
require('config.php');
if (!isset($_GET['table'])) {
die ('Please specify quot;tablequot; parameter');
}
$table = $_GET['table'];
$do = DB_DataObject::factory($table);
if (PEAR::isError($do)) {
die($do->getMessage());
}
49. Application template
// Find primary key
$keys = $do->keys();
if (is_array($keys)) {
$primaryKey = $keys[0];
}
// Find title field
$titleFields =
$_DB_DATAOBJECT_FORMBUILDER['CONFIG']['linkDisplayFields'];
if (isset($do->fb_linkDisplayFields)) {
$titleFields = $do->fb_linkDisplayFields;
}
55. Famous last words
To sum-up, aforementioned packages...
...unify form and data handling
...make it easy to train new project members
...speed up application development by at
least a factor of three
...make it easy to create universal
application frameworks, where new
functionality can easily be plugged in