skylark's avatar

skylark wrote a comment+100 XP

4d ago

JavaScript Essentials for PHP Developers : Ep 19, Turn The Radio On (Or Off)

Bit weird, ui is an IIFE that returns an object (thus ui becomes this object); ui object has one method, changeGameType(); Then we set this method on this very object, that is, the method works on itself?

skylark's avatar

skylark wrote a comment+100 XP

4d ago

JavaScript Essentials for PHP Developers : Ep 19, Turn The Radio On (Or Off)

@jeremymcpeak I love this course. It is highly engaging and beautiful. The above criticism is unfair because JS is a weird language that has been undergoing a global evolution.

skylark's avatar

skylark wrote a comment+100 XP

1w ago

JavaScript Essentials for PHP Developers : Ep 16, Event Basics

Jeremy, it is totally fine for the stuff not working and you debugging online. It creates a better connection with the instructor and the material.

skylark's avatar

skylark wrote a comment+100 XP

1w ago

JavaScript Essentials for PHP Developers : Ep 12, Static Members And Property Accessors

You can see clearly why people came up with a bunch of frameworks to tame this beautiful wild beast that is JavaScript, so fluid and dynamic that it is hard for the human brain to sculpt with. For a human, an object is something defined, structured, and static, whereas a function/method-process is something continuous, flowing, energy.

skylark's avatar

skylark liked a comment+100 XP

2w ago

JavaScript Essentials for PHP Developers : Ep 1, Structure, Syntax, And Scope

@parwina , you can also use the php -S localhost:8000 command in the project folder to run a local php server

skylark's avatar

skylark wrote a comment+100 XP

4w ago

PHP For Beginners: Ep 50, The Next Step in Your PHP Journey

@jeffreyway Thank you! I subscribed to more. I have to admit, though, that I was expecting you to announce at the end that we can build little apps in vanilla PHP (without frameworks) based on what you had thought. After all, Peter Levels used to build and ship production apps without any framework. Your structures and patterns are so much more sound and sophisticated.

skylark's avatar

skylark wrote a comment+100 XP

4w ago

Object-Oriented Principles in PHP: Ep 10, Object-Oriented Workshop

@jeffreyway, You mentioned an incoming Exceptions handling episode. Is it coming yet?

skylark's avatar

skylark wrote a comment+100 XP

4w ago

Object-Oriented Principles in PHP: Ep 10, Object-Oriented Workshop

@jtrod from PHP docs: "In PHP, it's possible to write else if (in two words) and the behavior would be identical to the one of elseif (in a single word). The syntactic meaning is slightly different (the same behavior as C) but the bottom line is that both would result in exactly the same behavior. ... Note: Note that elseif and else if will only be considered exactly the same when using curly brackets as in the above example. When using a colon to define if/elseif conditions, the use of elseif in a single word becomes necessary. PHP will fail with a parse error if else if is split into two words."

skylark's avatar

skylark wrote a comment+100 XP

4w ago

Object-Oriented Principles in PHP: Ep 10, Object-Oriented Workshop

@jtrod from PHP docs: "In PHP, it's possible to write else if (in two words) and the behavior would be identical to the one of elseif (in a single word). The syntactic meaning is slightly different (the same behavior as C) but the bottom line is that both would result in exactly the same behavior. ... Note: Note that elseif and else if will only be considered exactly the same when using curly brackets as in the above example. When using a colon to define if/elseif conditions, the use of elseif in a single word becomes necessary. PHP will fail with a parse error if else if is split into two words."

skylark's avatar

skylark wrote a comment+100 XP

2mos ago

PHP For Beginners: Ep 39, Introduction to Middleware

This code is simply beautiful!. But, is it still a beginner level? I wonder what advanced patterns look like.

skylark's avatar

skylark wrote a comment+100 XP

2mos ago

PHP For Beginners: Ep 30, PHP Autoloading and Extraction

@jeffreyway The weirdest bug ever - it may tickle your curiosity.

The bug came into existence after this massive refactoring here. Before, with the same router.php and same routes.php, all was fine and dandy, but it may not be related to it.

The route '/notes' broke.

When I typed this path in the URL or triggered it from the navigation, I was redirected to the public (page not found).

'/note' or 'notes/create' were working (as all the simple routes: home, about, contact) - this told me the issue was not in the DB connection.

Retyping routes.php did not fix the bug.

I came up with a workaround by simply renaming the faulty route '/notes_all' (other names were fine too: notess, nnotes, allnotes...

Maybe there is a conflict with some variable, but I am just guessing.

skylark's avatar

skylark wrote a comment+100 XP

2mos ago

PHP For Beginners: Ep 30, PHP Autoloading and Extraction

For XAMPP/LAMPP users (Ubuntu) who are lost in the sweeping changes during the Autoloading episode.

  1. I modified httpd.conf:

DocumentRoot "/opt/lampp/htdocs/name_of_your_app/public" <Directory "/opt/lampp/htdocs/name_of_your_app/public">

  1. I moved .htaccess to the public folder together with index.php; my .htaccess file below, no changes from earlier:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^.*$ index.php [L]

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

PHP For Beginners: Ep 15, Make a PHP Router

@lara324508 Thanks! It worked. Just a minor hiccup, the XAMPP dashboard degraded to the default HTML.

skylark's avatar

skylark liked a comment+100 XP

4mos ago

PHP For Beginners: Ep 15, Make a PHP Router

@Krishna-Clarke If you're using XAMPP on Ubuntu (Linux), you need to do the following:

By default, XAMPP uses /opt/lampp/htdocs as the root directory.
This can be changed by modifying the Apache configuration file located at:

/opt/lampp/etc/httpd.conf

In that file, you’ll find the default configuration:

DocumentRoot "/opt/lampp/htdocs"
<Directory "/opt/lampp/htdocs">

If you create a folder named /opt/lampp/htdocs/demo, you need to update the configuration as follows:

DocumentRoot "/opt/lampp/htdocs/demo"
<Directory "/opt/lampp/htdocs/demo">

Now, this folder becomes your new root directory, and accessing localhost/ will take you directly into it.


You should also add an .htaccess file to the root folder with the following content:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [L]

This file enables URL rewriting, so that when a user enters a non-existent URL, they are redirected to index.php.

skylark's avatar

skylark liked a comment+100 XP

4mos ago

PHP For Beginners: Ep 16, Create a MySQL Database

I use XAMPP on Ubuntu, and I’m completely satisfied with phpMyAdmin for database management.

skylark's avatar

skylark liked a comment+100 XP

4mos ago

PHP For Beginners: Ep 15, Make a PHP Router

Since I’ve noticed that there are many questions about setting up the environment to match the one Jeffrey is using, I’ll write a fresh guide for configuring the XAMPP environment on Ubuntu (Linux).

XAMPP Configuration on Ubuntu (Linux) Operating System

By default, XAMPP uses /opt/lampp/htdocs as the root directory.
This can be changed by modifying the Apache configuration file located at:

/opt/lampp/etc/httpd.conf

In that file, you’ll find the default configuration:

DocumentRoot "/opt/lampp/htdocs"
<Directory "/opt/lampp/htdocs">

If we create a folder /opt/lampp/htdocs/demo, we need to update the configuration to:

DocumentRoot "/opt/lampp/htdocs/demo"
<Directory "/opt/lampp/htdocs/demo">

Now, this becomes our root folder, and accessing localhost/ will point to it.


You should also add a .htaccess file in the root folder with the following content:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [L]

This file enables URL rewriting so that when a user enters a non-existent URL, they will be redirected to index.php.

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

PHP For Beginners: Ep 15, Make a PHP Router

If you don't want to use the ready-to-use method array_key_exists(), one look into the PHP docs on how to iterate associative arrays, and you can write your own function:

function uri_finder($k, $aarry) { foreach ($aarry as $key => $value) { if ($key === $k) { return $value; } } }

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

The Laracasts Snippet: Ep 10, I'm Done

@jeffreyway Thank you for fighting in the arena. Your job is not over. It has been more difficult than ever to learn well in the era of AI with all this noise, hype, race, and fog. Likewise, it has been a huge challenge to teach in this new era. That is why we need innovative and dedicated teachers, leaders, and practitioners, builders, the whole ecosystem. We need good, strong people who will cut AI to its size and put it in its place.

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

Vibe Coding Workshop: Ep 11, Annoying Things Agents Do

Thanks, great take. What's the economics of your vibe coding?

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

AI Developer Workflows: Ep 2, Refactoring AI

@JeffreyWay Fine, not human, noted. But the Notes looked and felt better in a quick scan.

skylark's avatar

skylark wrote a comment+100 XP

4mos ago

AI Developer Workflows: Ep 2, Refactoring AI

I prefer that the lesson Notes return to the PHP for Beginners series. The notes are great for quick reference. I do not need to chat with a bot anytime I need a quick refresher. The notes are from the teachers, so I trust them, and they feel human.