
Learn how a restful api works, including http methods, routing, and parameters, and how to set up, structure, and implement versioning for a Yii2 api.
Define what an api is, describe it as a contract and translator that lets programs interface and exchange requests and outputs, acting as an intermediary between clients and the kitchen.
Explore what makes a good API by examining documentation quality, clear expectations, understandable error codes, speed, redundancy, scalability, and backward compatibility.
Define rest as an architectural style with a uniform interface and stateless client–server interactions. Access resources through representations, improve performance with caching, and keep front-end and back-end independent for scalability.
Explore how to pass parameters to a restful api to query a website, request selective data, and understand constraints on results by country, birth year, or gender.
Set up your local server with XAMPP to begin building yii2 restfull API; install, launch, and run MySQL and Apache, then verify via phpMyAdmin and localhost.
Install composer, the php dependency manager, to install your project's required packages and extensions from getcomposer.org using the terminal.
Explore what an integrated development environment is and how to choose an IDE you’re most comfortable with for yii2 development, with options like phpstorm, netbeans, sublime, and atom.
Install Postman to interface with the API and test the Yii2 restful services. Download Postman from the website, install it on your system, and start exploring the Yii2 restful application.
Download and set up the yii2 framework for a restful api, choosing between decompressed zip or composer, and configure a localhost environment with xampp to run the basic app.
Install Yii2 using composer guides you through creating a project folder in xampp, opening a terminal, downloading composer.var, and running the composer installation for a basic Yii2 restful API.
open your browser and navigate to the yii framework directory to confirm the installation is running. move the basic directory into the main directory to finalize the setup.
Master mvc architecture by seeing how the model manages data and logic, the view renders state and collects input, and the controller translates requests into actions.
Demonstrates the five structures of yii2, explaining how core directories such as web, config, runtime, vendor, and assets organize controllers, models, views, layouts, and widgets.
Explore how yii2 controllers render pages such as home and login, define namespaces and actions, and create or test new actions in site and profile controllers.
Create a profile view and render index via the controller, using a shared layout to keep menus consistent while delivering data to front-end clients.
Mediate between the controller and the view, validate data, and render results; the contact form with name, image, subject, body, and verification code enforces required fields and email sending.
Set up a .htaccess file in the web folder to enable clean, per-page routing by directing non-existent files to index.php, creating pretty URLs for pages like about, contact, and profile/test.
Create a Yii2 rest API by structuring the API folders with config and modules, and enable versioning (v1 vs v2) to avoid breaking existing clients.
Create essential API files by copying browser files and adding new ones, adjust config web and params, copy htaccess and index.php into API folder, and set up aliases in alias.php.
Learn to point index.php to the correct vendor directory and create an @API alias using setAlias, enabling a clean API namespace and easier access to API files.
Discover how to configure the api using web.php and db.php in Yii2, including the params locator, database sharing, and a customized error handler.
Create the first version of your api module using gii, configure versioning with v1 to avoid breaking existing users, and adjust module setup in the web folder.
Structure your Yii2 project into two main directories, API and blog, update path references and vendor includes, and verify all routes remain fully functional after reorganization.
Learn to remove blog and web paths from a domain using htaccess, enable directory protection and symlinks, and configure rewrite rules to route to main site while preserving the API.
Set the project base url by replacing blog/web with an empty string in the web version, using the request base url and Yii to remove these paths.
Learn to customize Yii2 routes by mapping a friendly url to an existing controller and action, such as dashboard for default/index and login, via web.php rules in a v1 module.
Learn how to retrieve url parameters in Yii2 by mapping parameter names in actions, test with Postman, and display id or number values in the browser.
Remove the parameter title from urls to make routes more user friendly in a Yii2 restful api, by configuring the router and web config to pass parameters like age.
Learn to restrict input data types in yii2 by applying a digits rule so both name and age accept only numbers, ensuring numeric input like 44 renders correctly.
Master how to post form data and json input in Yii2 by switching from get to post, and disable CSRF validation in the requests config to accept external submissions.
Learn how to enable json input for a Yii2 restful api by configuring the json parser to accept json format. Observe how json data posts are parsed.
Post data with form data or json, then retrieve individual fields from the server using yii request. Access first name, last name, email, and username separately.
Enable json response in the Yii2 application by configuring the web response format to json, then verify with postman so the server returns json instead of html.
Create a new database named yii rest in phpmyadmin with utf8unicodeci, then configure the app to connect to this database using a single shared file for both api and web.
Create four tables for a blog backend, including users, posts, categories, and comments, with fields like id auto-increment, slug, title, body, category_id, authentication_key, status, created_at, and unique keys.
Generate models for posts, category, comments, and users using gii in the yii2 complete restful api guide, configuring namespaces and transferring models between the blog app and api models.
Generate a controller for the generated models by naming it after the model and appending controller, with index as the default action. Generate controllers for posts, categories, and users.
Move the generated controller and model files from blog to the api module v1, creating a models folder, and reference models from api controllers for unified access.
Correct the namespaces for files moved into api by aligning controllers and models, as generated by Gii, so postman and browser can access them.
This course will teach you how to Build and design your own web project with Yii2 framework, to consume services and APIs online.
In this course, you will learn the step-by-step processes to get started with API development with Yii2 for general consumption. You will learn how to use HTTP protocol to consume the resources your web services is meant to provide.
Are you a frontend developer, do you have a mobile product idea, do you want to create your own startup or you just want to build a technology but you need an API? This is course for you.
What are you going to learn?
Understand API and how it works better
Learn, what is HTTP and how it works
You will learn how to use postman to test API
How to properly install Yii2 framework
How to correctly structure your API project
You will understand how and when Gii comes to play
How to properly configure your response for consumption
How to send request to API and how to consume it
How to authenticate access to your API using different options
How to version your API if your update is not backward compatible
And many more.
Don't wait, and enroll today to take another step toward web services mastery!
Looking forward to having you in my course!