SWDPP401 - PHP PROGRAMMING
SWDPP401
BDCPC301 - Apply PHP Programming
Competence
RQF Level: 4 Learning Hours
130
Credits: 13
Sector: ICT and Multimedia
Trade: Software Development
Module Type: Specific
Curriculum: ICTSWD4002: TVET Certificate IV in Software Development
Copyright: © Rwanda TVET Board, 2023
Issue Date: September 2023
2|Page
This module describes the skills, knowledge, and attitude required to apply php
programming. This module is intended to prepare students pursuing TVET Level
Purpose 4 in software development. At the end of this module, the students will be able
statement to Apply PHP Fundamentals, Connect PHP to the Database, and Build a Content
Management System (CMS) using PHP, Build a web app using MVC Framework
(LARAVEL)
Learning assumed
to be in place
Training delivery 100% Assessment Total 100%
Theoretical content 30% 30%
Practical work:
Group project
Formative
Delivery modality and 20% 50%
70% assessment 70%
presentation
Individual project
50%
/Work
Summative Assessment 50%
1|Page
Elements of Competence and Performance Criteria
Elements of competence Performance criteria
1.1 Environment is properly prepared based on PHP Requirements.
1.2 PHP Concepts are effectively applied based on PHP standards.
1.Apply PHP
1.3 PHP Security concepts are effectively applied based on security best
Fundamentals
practices
1.4 OOP concepts are effectively applied based on PHP Standards
2.1 Connection is properly established based on specified database
environment
2.2 CRUD Operations are effectively performed based on PHP
standards
2. Connect PHP to the 2.3 Security is effectively enforced based PHP data protection
Database standards
2.4 Errors and exceptions are correctly handled based on error handling
standards
2.5 User authentication are effectively performed based on Web Page
Control
3.1 Dynamic Content Navigation is properly built based on PHP
standards
3. Build a Content
3.2 Cookies and Sessions are properly managed based on PHP
Management System
standards
(CMS) using PHP
3.3 Context options are effectively applied on PHP standards
3.4 Pages access are effectively regulated based on PHP standards
2|Page
3.5 CMS Errors and Logging is properly detected based on CMS security
3.6. CMS is effectively maintained based on PHP Standards
4.1 Environment is properly configured based on Laravel Framework
Standard
4.2 Custom routing is effectively set based on Laravel Framework
Standard
4.3 Form Data are properly validated based on Laravel Framework
standard
4. Build a web app using
MVC Framework 4.4 CRUD operations are effectively performed based on Laravel
(LARAVEL) framework standard
4.5 APIs are properly managed based on web app requirements
4.6 Web Application is effectively secured based on framework security
standard
4.7 Source code changes are properly managed according to the
version control standard
3|Page
Course content
Learning outcomes At the end of the module the learner will be able to:
1. Apply PHP Fundamentals
2. Connect PHP to the Database
3. Build a Content Management System (CMS) using PHP
4. Build a web app using MVC Framework (LARAVEL)
Learning outcome 1: Apply PHP Fundamentals. Learning hours: 40
Indicative content
Preparation of PHP Programming environment
Definition of key terms
PHP
Interpreter
Open Source
Web Server
Apache
Database
DBMS
MySQL
Static website
Dynamic website
Purpose of PHP
Important characteristics of PHP
PHP Development Tools
4|Page
XAMPP
WAMP/MAMP/LAMP
IDEs /Text Editors
Browser
Installation of XAMPP/WAMP or LAMP
Configuration of environment
Ports
Browser
Services
IDEs Extensions
Application of PHP concepts
PHP file extension
Syntax
Variable
Operators
Data types
Variable scope
Constants
Comment
Date and time
String concatenation
Condition statement
Arrays
Loop
Function
Introduction to function
Built-in functions
User-defined functions
calling function
5|Page
Function recursion
Super Global variables
PHP file handling
Opening a file
Reading a file
Writing a file
Closing a file
Deleting a file
● Application of PHP Security concepts
PHP form handling
Post Method
Get Method
Validation
Cookies and Session
● Implementation of Object-oriented programming (OOP) in PHP
Definition
Classes
Objects
Inheritance
Access modifiers
Encapsulation
Abstraction
Polymorphism
Resources required for the learning outcome
Equipment Computer
Books
Materials Tutorials
Internet
6|Page
textditor
IDE
Tools
Browser
Xampp/Wampp
Demonstration and simulation
Facilitation Individual and group work
techniques Practical exercise
Group discussion
Formative Written assessment
assessment methods Oral presentation
/(CAT) Practical Assessments
Learning outcome 2: Connect PHP to the Database Learning hours: 37
Indicative content
● Application of Database Connection drives
Mysqli
Mysqli - OOP
PDO
● Perform database CRUD Operations
CRUD with Mysqli
CRUD with Mysqli – OOP
CRUD with PDO
Import and export database
● Application of PHP Basic security concepts
Input Validation
Password Security
7|Page
Cross-Site Scripting (XSS) Prevention
Cross-Site Request Forgery (CSRF) Prevention
Session Security
File Uploads
Error Reporting
● Errors and exceptions in PHP
Introduction
Types of errors
Exception Handling
Simple “die ()” statements
Custom error and error triggers
Error reporting
● Implementation of user authentication
Introduction
Types of user authentication
User authorization
Create User authentication
Start a session
Authenticate the user
Protect pages
Resources required for the indicative content
Equipment Computer
Books
Materials Tutorials
Internet
textditor
Tools IDE
Browser
8|Page
Xampp/Wampp
Demonstration and simulation
Facilitation Individual and group work
techniques Practical exercise
Group discussion
Formative Written assessment
assessment methods Oral presentation
/(CAT) Practical Assessments
Learning outcome 3: Build a Content Management
Learning hours: 25
System (CMS) using PHP
Indicative content
Preparation of Content Management System (CMS)
Introduction to CMS
Prepare CMS Environment
Blueprint the application
Set up the database
Set up project files and folders
Build dynamic content navigation
List subjects
Add pages for each subject
Add page content
Use the navigation to select pages
Management of cookies and sessions
Work with cookies
Set and read cookies values
Unset cookie values
9|Page
Work with sessions
Set and read session values
Unset Session
Application of Context and Options
The public content
Skip hidden subjects and pages
Use an option for conditional code
Insecure direct object reference
Project page visibility
Allow html in dynamic contents
Regulate page access
User authentication overview
Create admins table
Build admin Dashboard
PHP password functions
Authentication user access
Require authorization
Log out user
Optional password updating
Authorized previewing
CMS Errors Detection
Description of CMS Errors
Application of Errors testing
Maintain CMS
Regular updates
Plugin and module updates
Regular backups
Database optimization
Security measures
10 | P a g e
Performance monitoring
Resources required for the indicative content
Equipment Computer
Books
Materials Tutorials
Internet
Textditor
IDE
Tools Browser
Xampp/Wampp
Scratch
Demonstration and simulation
Facilitation Individual and group work
techniques Practical exercise
Group discussion
Formative Written assessment
assessment methods Oral presentation
/(CAT) Practical Assessments
11 | P a g e
Learning outcome 4: Build a web app using MVC
Learning hours: 28
Framework (LARAVEL)
Indicative content
Framework environment configuration
Introduction to PHP framework
Most popular PHP frameworks
Characteristics of each
Advantages and disadvantages/limitations of each
Laravel MVC Architecture (Model, View, Controller)
Installation of Laravel framework
Laravel .env file configuration
Use blade template for Laravel
Setup Laravel custom routing
Web and API routing
Laravel basic routing
Routing parameters
Laravel named routes
Laravel middleware
Laravel route groups
Perform form data validation
CSRF Token
Form Elements
Perform CRUD Operations
Configure database file
Create Controllers for Laravel CRUD
Create Models for Laravel CRUD
Creation of migration
12 | P a g e
Perform Seeding
Create Views for Laravel CRUD
Laravel CRUD operation routes
Manage APIs In Laravel frameworks
Introduction to API development
RESTful APIs
Understanding RESTful architecture
Building RESTful APIs with Laravel
Test APIs with Postman
Handling HTTP requests and responses
API Resources
Creating API resources
Returning resources as JSON
Encoding API data
Authentication and Security
Implementing API authentication
Best practices for API security
Managing API security
API Versioning and Documentation
Versioning your API
Documenting your API with Swagger/Postman
Best practices for API documentation
Resources required for the indicative content
Equipment Computer
Books
Materials Tutorials
Internet
Tools textditor
13 | P a g e
IDE
Browser
Xampp/Wampp
Laravel Frameworks
Demonstration and simulation
Facilitation Individual and group work
techniques Practical exercise
Group discussion
Formative Written assessment
assessment methods Oral presentation
/(CAT) Practical Assessments
14 | P a g e
Integrated/Summative assessment
Integrated situation
XY Shop is located in Kigali City, Kicukiro District Sales shoes and clothes.
The Shopkeeper (someone who owns or manages a shop) uses a file system (books) to record
stock information. This filling system has a problem with non-efficient security, accessibility, and
integrity of information about the stock-in and stock-out, not only that but also lacks an easy way
to produce a daily/weekly report of the stock.
They hired a database designer who designed the database model that can be used to manage
the stock. The designed database is below:
Database Name: XY_Shop
Tables:
Shopkeeper (ShopkeeperId (PK), UserName, Password)
Product (ProductCode (PK), ProductName)
ProductIn (ProductCode (FK), DateTime, Quantity, UnitPrice, TotalPrice)
ProductOut (ProductCode (FK), DateTime, Quantity, UnitPrice, TotalPrice)
The XY Shop has hired you as a web application developer to develop a web application using
Laravel that enables the Shopkeeper to :
Record/insert the products with the ability to view, modify and delete products.
Generate a report of stock status and the total price of stock-in or stock-out.
Instruction
The shopkeeper must have an account in order to login into the system before starting all
other activities
Create an application directory on your desktop and rename it with your
FirstName_LastName and save your work.
The application is needed in four (4) hours.
15 | P a g e
Resources
TextEdit, VS code , PHPStorm, Browser, Xampp and
Tools
Laravel Frameworks
Equipment Computer
Materials/ Consumables Electricity
Assessment criteria Observation
Assessable Marks
(Based on performance Indicator
outcomes Yes No allocation
criteria)
Ind.1 Required
5
tools are Selected
1.1 Environment is
Ind.2 PHP
properly prepared based
Development
on PHP Requirements 5
Learning
Environment is
outcome
configured
1:Apply PHP
1.2 PHP Concepts are Ind.1 Variables are
Fundament 5
effectively applied Applied
als
based on PHP
Ind.2 Function are
standards. 6
used
Ind.3 Control
statement is 6
Implemented
2.1. Connection is
Learning properly established Ind.1 Database is
6
outcome 2: based on specified connected
database environment
16 | P a g e
Connect 2.3 PHP Security
PHP to the concepts are effectively Ind.1 Cookies and
6
Database applied based on security Session are applied
best practices
2.5 User authentication
Ind.1 User
are effectively performed
authentication are 5
based on Web Page
performed
Control
Ind.1 Laravel
Framework is 5
4.1. Environment is Installed
properly configured
Ind.2 Laravel. env
based on Laravel 6
file is Configured
Learning Framework Standard
Ind.3. Blade
outcome 3: 2
template is used
Build a web
4.2. Custom routing is
app using
effectively set based on Ind.1 Custom
MVC 6
Laravel Framework routing is applied
Framework
Standard
(LARAVEL)
4.3 Form Data are Ind.1 data
properly validated based validation is 8
on Laravel Framework performed
standard
Ind.2 Form
handling are 6
applied
17 | P a g e
Ind.1. Database is
Configured 5
Ind.2. Models are
created 4
4.4 CRUD operations are
effectively performed
Ind.3. Migration is
based on Laravel
created 4
framework standard
Ind.4 CRUD
operations are
10
performed
Total marks 100
Percentage Weightage 100%
Minimum Passing line % (Aggregate): 70%
18 | P a g e
References
1. Bierer, D. (2016). PHP 7 programming book. Birmingham B32PB,UK: Pack publishing
LTD.
2. javatpoint. (2023, may 6th saturday). https://www.javatpoint.com/laravel. Retrieved
from javatpoint: https://www.javatpoint.com/
3. javatpoint. (2023, may 4th thursday). https://www.javatpoint.com/php-tutorial.
Retrieved from javatpoint: https://www.javatpoint.com
4. JavaTpoint. (2023, may 6th saturday). javatpoint. Retrieved from javatpoint tutorial:
https://www.javatpoint.com/
5. Jesus Castagnetto, H. R. (1999). professional PHP Programming. Birminghan: Wrox press
Lmd.
6. Nixon, R. (2014). Learning php,mysql,java script ,css&HTML,third edition. USA: Oreilly
media.
7. Otwell., a. (2023, may saturday on 6th). The PHP Framework for web artisan. Retrieved
from laravel official website: https://laravel.com/docs/10.x
8. popel, D. (2007). Learning data object. Luna park sydney: pack publisher.
19 | P a g e