Part of the EllisLab Network
   
 
Documentation: SMALL Typos
Posted: 02 November 2008 05:53 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  4
Joined  11-02-2008

First off just want to say the documentation is stellar. I’m using CodeIgniter because of it!

Anyway, I read through everything but the class references and I found a few small things I think might be bugs. SMALL.


Bug On Page: http://codeigniter.com/user_guide/general/routing.html
Is it bug?: - the example shows (:num) not (:any) when in the explanation it says “any”

$route['product/(:num)'"catalog/product_lookup_by_id/$1"

A URL with “product” as the first segment, and anything in the second will be remapped to the “catalog” class and the “product_lookup_by_id” method passing in the match as a variable to the function.

 


Bug On Page: http://codeigniter.com/user_guide/general/routing.html#remapping
Is it bug?: the example has: $this->$method(); and in the next line $this->default_… Shouldn’t it just be $this->method() (maybe it was meant to be $$method() ?)

The overridden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:

function _remap($method)
{
    
if ($method == 'some_method')
    
{
        $this
->$method();
    
}
    
else
    
{
        $this
->default_method();
    
}
Profile
 
 
Posted: 02 November 2008 06:58 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  3103
Joined  01-07-2008

You’re right that the first one should read:

...and a number in the second…

The second one is correct though.  $method will be replaced with ‘some_method’, so it will be equivalent to:

$this->some_method(); 

It’s called a variable function.

Welcome to CodeIgniter.

 Signature 
Profile
MSG
 
 
Posted: 02 November 2008 07:04 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  4
Joined  11-02-2008

thanks! I didn’t know you could do a variable method like that.

I got my first site up and running today. I’ve used cake in the past but I’ve never gotten into it enough to really enjoy it. CodeIgniter was a breeze.

smile

Profile
 
 
Posted: 19 November 2008 03:17 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1101
Joined  08-06-2006

put documentation typos in the bug tracker (link on CI home page) and they will get fixed - there is even a separate category for them.

thanks.

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

Profile
 
 
Posted: 20 November 2008 05:26 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  10
Joined  11-05-2008
http://codeigniter.com/user_guide/libraries/file_uploading.html 

almost bottom of the page( Explanation table):

image_heigth 

it should be

image_height 
 Signature 

http://www.southdreamz.com
http://gallery.southdreamz.com cool smile

Profile
 
 
Posted: 20 November 2008 09:48 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1101
Joined  08-06-2006

@palZ…

post it in the bug tracker.

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

Profile
 
 
Posted: 26 March 2010 03:00 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  2
Joined  03-26-2010

Hello,

I’m a new CI user and I just found this typo when I was reading the User Guide. I was going to open a new thread but before that I decided to search the forum, so I found this thread.
So I’m totally confused. Is it really a typo or it is correct, since this thread is almost 2 years old and the text has not been changed until now? Pascal Kriete says it is an error, I tested and come to the same conclusion, since the results are not correct as expected.
It took 1 hour from my time until now, so I’m going to “Report a bug” as Lab Technician suggested, so it will save some time to everybody reading this in future, I hope.

$route['product/(:num)'"catalog/product_lookup_by_id/$1"

A URL with “product” as the first segment, and anything in the second will be remapped to the “catalog” class and the “product_lookup_by_id” method passing in the match as a variable to the function.

Profile