Welcome Guest, Not a member yet? Register   Sign In
New vid: 3 New Features in CI 4.0.4
#14

(This post was last modified: 01-16-2021, 04:08 AM by Corsari.)

Where to point out not best choices for the user guide and or user guide examples?



(sorry to be slightly off topic and though sorry but I can't help with development, but I can do something with user guide hints and enhancements)



e.g.

https://codeigniter.com/user_guide/incom...aceholders



the first snippet is

PHP Code:
$routes->add('product/(:num)''App\Catalog::productLookup'); 
and its note tells

In a route, the first parameter contains the URI to be matched, while the second parameter contains the destination it should be re-routed to. In the above example, if the literal word “product” is found in the first segment of the URL, and a number is found in the second segment, the “AppCatalog” class and the “productLookup” method are used instead.



it should be :any instead as written later in the examples

PHP Code:
$routes->add('product/(:any)''Catalog::productLookup'); 


or again, taken from the examples, it should be changed to a less confusing
PHP Code:
'Catalog::productLookupByID/$1' 


if you agree, like the later example shows



PHP Code:
$routes->add('product/(:num)''Catalog::productLookupByID/$1'); 



the first snippet will kill newbies and students especially when they later will reach the examples section




I have seen others (sort of) incongruities around, like the word 'post' choosen to be written lowercase in the blog tutorial

were post will be confused by post/posts in the blog, where the tutorial itself referers to a blog,



instead it could clarify writing POST uppercase

I mean this page https://codeigniter.com/user_guide/tutor...items.html



if you go to the the second section "Create a form", its code snippet is



PHP Code:
<h2><?= esc($title); ?></h2>

<?= \Config\Services::validation()->listErrors(); ?>

<form action="/news/create" method="post">
    <?= csrf_field() ?>




method="post", just to "help" newbies and students, can be written method="POST"



yes PHP coders will laugh .. but the tutorial is such basic that I would guess is NOT meant to be thought nor for PHP experienced coders neither for just PHP coders , it is meant for newbies and students,



since unhappily the tutorial context is the one of a blog, the 'post' lowercase will cause a short-circuit in the newbie reader



-----



Just to mention a couple



So could turn in a a courteous kindness towards students readers, to edit the tutorial and begin fixing these two


P.S. kindly allow to add a third one
the controversy routes

in this page
https://codeigniter.com/user_guide/incom...ting-rules

a brief introduction is written

but immediately right after it begins a section PlaceHolders

https://codeigniter.com/user_guide/incom...aceholders

where the the
Code:
add()
method appears and it is exampled many times along the entire (long) URI Routing page

... well the implication suggests that e.g.

$routes->add('product/(:num)', 'App\Catalog::productLookup');

should be written into the app/config/Routes.php file ...

but nowhere along the page is found a snippet with a practical example , nowhere in the entire https://codeigniter.com/user_guide/incom...uting.html page

and to be honest, I just guess it and I ask myself too, are all those $routes->add() to be written in app/config/Routes.php?

and

if the code $routes->add('product/(:num)', 'App\Catalog::productLookup'); has to be placed in that file ... where it should be added?

in

/**
 * --------------------------------------------------------------------
 * Router Setup
 * --------------------------------------------------------------------
 */


or in

/**
 * --------------------------------------------------------------------
 * Route Definitions
 * --------------------------------------------------------------------
 */


or

/**
 * --------------------------------------------------------------------
 * Additional Routing
 * --------------------------------------------------------------------
 */


everything above could look silly but these are the questions that will make students to abandon
Reply


Messages In This Thread
New vid: 3 New Features in CI 4.0.4 - by kilishan - 07-16-2020, 09:43 PM
RE: New vid: 3 New Features in CI 4.0.4 - by Corsari - 01-16-2021, 03:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB