Welcome Guest, Not a member yet? Register   Sign In
Documentation could be more newbie-friendly
#2

(This post was last modified: 02-21-2021, 04:59 PM by kenjis.)

(02-21-2021, 08:12 AM)Fluffy Wrote: But the documentation could use a bit more examples for people who are new to CI 4 (and new to PHP 7 and namespaces, if I'm honest).
For example, when I tried to configure the encryption key for the Encryption Library, it took me a while to understand that where it said :

PHP Code:
// $key will be assigned a 32-byte (256-bit) random key
$key Encryption::createKey(); 

it should actually have said :

PHP Code:
// $key will be assigned a 32-byte (256-bit) random key
$key = \CodeIgniter\Encryption\Encryption::createKey(); 

When I did what the documentation said, I got an error saying PHP couldn't find the Encryption class. It only worked when I fully typed out the namespaced class name.
So in the strictest sense, the documentation is wrong, or at least incomplete.
Yes, you are correct. I will fix it.

I send PR.
https://github.com/codeigniter4/CodeIgniter4/pull/4320

(02-21-2021, 08:12 AM)Fluffy Wrote: The above is just one example of several situations I've encountered so far, where I needed to do some guessing and trial-and-error to get the (incomplete) examples in the documentations to actually work.
If you know another place where has code that does not work,
feel free to point it out.
Reply


Messages In This Thread
RE: Documentation could be more newbie-friendly - by kenjis - 02-21-2021, 04:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB