Skip to content

Commit 358ed5b

Browse files
Copilotlcharette
andcommitted
Improve chapter introductions with problem-solution structure
Co-authored-by: lcharette <2566513+lcharette@users.noreply.github.com>
1 parent 67e3b30 commit 358ed5b

6 files changed

Lines changed: 29 additions & 11 deletions

File tree

app/pages/6.0/04.installation/chapter.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ wip: true
88

99
# Installation
1010

11-
Now that we've gone over the basic structure of a UserFrosting based application, it's time to get things started. This chapter covers UserFrosting's environment dependencies and how to use your essential developer tools to start a UserFrosting project.
11+
Before you can build amazing web applications with UserFrosting, you need a development environment with the right tools. Setting this up might seem daunting if you're new to PHP development, but this chapter walks you through everything step by step.
12+
13+
We'll cover UserFrosting's system requirements (PHP, Composer, Node.js), show you how to set up your development environment (whether you prefer native installation or Docker), and use the Bakery CLI tool to create your first project.
14+
15+
By the end of this chapter, you'll have a fully functional UserFrosting installation running on your local machine, ready for development. Whether you're on Windows, macOS, or Linux, we'll get you up and running.

app/pages/6.0/06.sprinkles/chapter.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ wip: true
88

99
# Sprinkles
1010

11-
The **sprinkle** system is a modular, flexible approach to separating core functionality from developer-added code and content.
11+
When building a web application, you face a fundamental challenge: **how do you extend and customize functionality without modifying the core codebase?** Directly editing framework code creates maintenance nightmares—every update risks breaking your changes, and sharing your work becomes nearly impossible.
1212

13-
This is a powerful means of customizing your site without having to modify UserFrosting's core code. It also allows the UserFrosting community to share and integrate functionally cohesive units of code and content across projects.
13+
UserFrosting solves this with **sprinkles**—a modular system that lets you extend and override default behavior without touching core code. Think of sprinkles like toppings on ice cream: the base (core framework) stays intact, while you add your own flavors on top.
14+
15+
This chapter explains how sprinkles work, how to create your own, and how to leverage community sprinkles to accelerate your development. You'll learn to build maintainable, modular applications that stay easy to update and share.

app/pages/6.0/07.dependency-injection/chapter.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ wip: true
88

99
# Dependency Injection
1010

11-
Dependency injection is one of the fundamental pillars of modern object-oriented software design. It is used extensively throughout UserFrosting to glue all services together while maintaining great flexibility to extend the basics functionalities of UserFrosting to create your own project.
11+
Modern applications need shared functionality—sending emails, logging events, authorizing users. But how do you make these services available throughout your code without creating tight coupling and making your code untestable?
1212

13-
Services are a way to allow objects that perform specific, commonly used functions to be reused throughout your application. Mail, logging, and authorization are all examples of services. The **Dependency Injection (DI) Container** provides an elegant and loosely coupled way to make various services available globally in your application.
13+
**Dependency Injection (DI)** is the solution. Instead of objects creating their own dependencies, they declare what they need, and a **DI Container** provides them. This makes code modular, testable, and flexible—you can easily swap implementations without changing dependent code.
14+
15+
UserFrosting uses dependency injection extensively to wire together services like mail, logging, database access, and authorization. Understanding the DI container is key to extending UserFrosting's functionality and building well-architected applications.
16+
17+
This chapter explains dependency injection concepts, how UserFrosting's DI container works, the services available by default, and how to add or customize services for your own needs.

app/pages/6.0/08.routes-and-controllers/chapter.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ wip: true
88

99
# Routes and Controllers
1010

11-
UserFrosting controllers are used to mediate interactions between the model and view, and are responsible for much of your application's logic.
11+
Every web application needs to answer a fundamental question: **when a user visits a URL or submits a form, what code should run?** Without a structured approach, you end up with spaghetti code mixing database queries, business logic, and HTML generation in confusing, unmaintainable ways.
1212

13-
This chapter explains RESTful design, the front controller pattern, creating new controllers and controller methods to implement the logic for your application, and how to properly handle input from the client.
13+
UserFrosting uses the **MVC (Model-View-Controller)** pattern with RESTful routing to cleanly separate concerns. **Routes** map URLs to **controllers**, which contain your application logic and coordinate between **models** (data) and **views** (presentation). This separation makes your code easier to understand, test, and maintain.
14+
15+
This chapter covers RESTful API design, the front controller pattern, creating controllers for your features, and securely handling user input. You'll learn to build well-structured endpoints that are both powerful and maintainable.
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22
title: Pages and Twig Templating
3-
description: A web page is a synthesis of HTML, CSS, Javascript, and other types of media. UserFrosting uses the powerful Twig templating engine to render web pages.
3+
description: A web page is a synthesis of HTML, CSS, Javascript, and other types of media. UserFrosting uses the powerful Twig templating engine to render web pages.
44
wip: true
55
---
66

77
#### Chapter 12
88

99
# Pages and Twig Templating
1010

11-
In this chapter, we discuss how to use the powerful Twig templating engine to cleanly separate the content of your web pages from the logic.
11+
Building web pages by mixing PHP logic and HTML markup in the same file creates unreadable, unmaintainable code. You end up with security risks (like XSS vulnerabilities), difficulty in collaborating with designers, and code that's nearly impossible to test.
12+
13+
UserFrosting uses **Twig**, a powerful templating engine that cleanly separates your presentation (HTML) from your application logic (PHP). Twig provides a simple, secure syntax for displaying data, building layouts, and composing reusable template components—all while automatically escaping output to prevent security issues.
14+
15+
This chapter teaches you how to create templates, use Twig's features effectively, organize templates in your sprinkles, and leverage UserFrosting's custom Twig extensions. You'll learn to build beautiful, maintainable page layouts that keep your code clean and secure.

app/pages/6.0/14.database/chapter.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ wip: true
88

99
# The Database and ORM Layer
1010

11-
UserFrosting uses Laravel's [Eloquent](https://laravel.com/docs/8.x/eloquent) component to provide a convenient abstraction layer on top of your database. This allows you to quickly manipulate the database from within your controllers without needing to write tedious, repetitive queries each time.
11+
Every application needs to store data—user accounts, content, settings, and more. But writing raw SQL queries for every database operation leads to repetitive code, security vulnerabilities (like SQL injection), and maintenance headaches.
1212

13-
We also discuss how to create database migrations, allowing you to easily set up your database tables, and database seeds, allowing your to populate the database with default values.
13+
UserFrosting uses Laravel's [Eloquent ORM](https://laravel.com/docs/eloquent) to solve these problems. An **ORM (Object-Relational Mapper)** lets you work with database records as PHP objects, automatically handling queries, relationships, and data validation. Instead of writing SQL, you write intuitive PHP code that's easier to read, test, and secure.
14+
15+
This chapter covers everything you need to work with databases in UserFrosting: defining models, querying data, managing relationships, creating migrations to version your schema, and seeding initial data. You'll learn to build robust, maintainable data layers for your applications.

0 commit comments

Comments
 (0)