11# Playground
2+
23A space to learn and experience CodeIgniter 4
34
45[ ![ ] ( https://github.com/codeigniter4projects/playground/workflows/PHPUnit/badge.svg )] ( https://github.com/codeigniter4projects/playground/actions/workflows/test.yml )
@@ -8,78 +9,84 @@ A space to learn and experience CodeIgniter 4
89
910This playground is here to help you learn CodeIgniter 4 by example. We try to cover use cases for the most
1011common tasks you'll find yourself doing in web applications. Where there are multiple ways to do something,
11- we've tried to give examples of doing things in each way.
12+ we've tried to give examples of doing things in each way.
1213
1314This isn't meant to replace [ the docs] ( https://codeigniter4.github.io/CodeIgniter4/index.html ) . This is just
14- something to look at to get a deeper understanding, or to better see how something could be done in practice.
15+ something to look at to get a deeper understanding, or to better see how something could be done in practice.
1516
1617## Resources
1718
18- There are two primary ways to learn about what's going on here in the Playground. The first is the code itself.
19- We've heaped a LOT of comments throughout the code. They're your best docs. So explore them in depth.
20- Additionally, there's a small collection of docs in the conveniently named [ docs] ( docs ) folder.
19+ There are two primary ways to learn about what's going on here in the Playground. The first is the code itself.
20+ We've heaped a LOT of comments throughout the code. They're your best docs. So explore them in depth.
21+ Additionally, there's a small collection of docs in the conveniently named [ docs] ( docs ) folder.
2122
22- To setup a working playground on your own local device, read through the next section.
23+ To setup a working playground on your own local device, read through the next section.
2324
24- ## Getting Started
25+ ## Getting Started
2526
2627In order to get the playground setup on your own computer, you'll need a few minimum requirements - all of which
2728are listed on [ CodeIgniter's repo] ( https://github.com/codeigniter4/CodeIgniter4#server-requirements ) . Basically,
28- as long as you are running PHP 7.2 or later you'll meet most of them.
29+ as long as you are running PHP 7.2 or later you'll meet most of them.
2930
30- While CodeIgniter does not require it, using this repo also requires the use of
31- [ Composer] ( https://getcomposer.org/ ) to install CodeIgniter as a dependency, and PHPUnit - the test framework.
31+ While CodeIgniter does not require it, using this repo also requires the use of
32+ [ Composer] ( https://getcomposer.org/ ) to install CodeIgniter as a dependency, and PHPUnit - the test framework.
3233You don't need that installed globally, and we actually recommend against it, since different projects likely
33- require different versions of PHPUnit installed as time goes on and it can become tricky maintain a local
34- environment that works with all of the different versions.
34+ require different versions of PHPUnit installed as time goes on and it can become tricky maintain a local
35+ environment that works with all of the different versions.
3536
3637While it can be downloaded as a zip and extracted, we'll use [ git] ( https://git-scm.com/ ) to manage things.
3738
38- With those out of the way, it only takes a few small steps to get the project up and running locally.
39+ With those out of the way, it only takes a few small steps to get the project up and running locally.
3940
40411 - Clone the repo if you haven't already, from the CLI:
4142
42- git clone https://github.com/codeigniter4projects/playground
43+ git clone https://github.com/codeigniter4projects/playground
4344
4445That creates a new directory, ` playground ` , under your current directory.
4546
46472 - Enter the new directory and install the project dependencies with Composer. NOTE: The command shown
4748here assumes that you have Composer loaded globally. If you don't, then pretend we're using ` composer.phar ` .
49+
4850```
4951cd playground
5052composer install
5153```
5254
53553 - Copy ` .env.example ` in the project directory and name it ` .env ` . Then open it up and verify the settings:
5456
55- * First, ` CI_ENVIRONMENT ` is set to ` development ` as this enables error handling, the debug toolbar, and some other
56- things handy while in development.
57+ - First, ` CI_ENVIRONMENT ` is set to ` development ` as this enables error handling, the debug toolbar, and some other
58+ things handy while in development.
59+
60+ - Next make sure that ` app.baseURL ` matches whatever you are currently running your site at. If you use ` spark ` ,
61+ then it already matches the default. If this doesn't match, then generated links might not work, and your
62+ developer toolbar will never show up.
5763
58- * Next make sure that ` app.baseURL ` matches whatever you are currently running your site at. If you use ` spark ` ,
59- then it already matches the default. If this doesn't match, then generated links might not work, and your
60- developer toolbar will never show up.
64+ - Finally while you're in there, you can edit your database settings, though you can do that in ` app/Config/Database.php `
65+ just as easily. Since we won't deploy this to multiple servers it's no big deal to edit the config files directly.
6166
62- * Finally while you're in there, you can edit your database settings, though you can do that in ` app/Config/Database.php `
63- just as easily. Since we won't deploy this to multiple servers it's no big deal to edit the config files directly.
67+ 4 - Back on the command line, we install all of the needed database tables and sample data.
6468
65- 4 - Back on the command line, we install all of the needed database tables and sample data.
6669```
6770php spark migrate
6871php spark db:seed PlaygroundSeeder
6972```
7073
71745 - That's it! If you're hosting through Apache, Nginx, etc, then head to your site. If you just want a quick
72- way to work with your site locally, go back to the CLI and start up ` spark ` , CodeIgniter's small server.
75+ way to work with your site locally, go back to the CLI and start up ` spark ` , CodeIgniter's small server.
7376
74- php spark serve
77+ php spark serve
7578
76- If you get would like to change the port it's running on, that's no problem:
79+ If you get would like to change the port it's running on, that's no problem:
7780
78- php spark serve --port 8081
81+ php spark serve --port 8081
7982
80- Enjoy!
83+ Enjoy!
8184
8285## Code Challenges
8386
84- There are some portions of the code intentionally left for * you * to finish. Once you are familiar with
87+ There are some portions of the code intentionally left for _ you _ to finish. Once you are familiar with
8588the project and have read through the docs try searching the code for anything with the comment ** Help!** .
89+
90+ ## Images
91+
92+ All images in this repo were created by MidJourney and are can be used freely in non-commercial use cases.
0 commit comments