Skip to content

Commit

Permalink
Merge pull request #2827 from pjio/documentation-fixes
Browse files Browse the repository at this point in the history
Documentation fixes
  • Loading branch information
lonnieezell authored Apr 16, 2020
2 parents 611d3bb + ecc4250 commit 8b97001
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 88 deletions.
8 changes: 4 additions & 4 deletions user_guide_src/source/cli/cli_library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ method which takes the string to output as the first parameter::

CLI::write('The rain in Spain falls mainly on the plains.');

You can change the color of the text by passing in a color name as the first parameter::
You can change the color of the text by passing in a color name as the second parameter::

CLI::write('File created.', 'green');

Expand Down Expand Up @@ -137,7 +137,7 @@ to STDERR, instead of STDOUT, like ``write()`` and ``color()`` do. This can be u
for errors so they don't have to sift through all of the information, only the actual error messages. You use it
exactly as you would the ``write()`` method::

CLI::error('Cannot write to file: '. $file);
CLI::error('Cannot write to file: ' . $file);

**wrap()**

Expand Down Expand Up @@ -170,11 +170,11 @@ every line after the first line, so that you will have a crisp column edge on th
{
CLI::write(
// Display the title on the left of the row
$title[$i].' '.
$title[$i] . ' ' .
// Wrap the descriptions in a right-hand column
// with its left side 3 characters wider than
// the longest item on the left.
CLI::wrap($descriptions[$i], 40, $maxlen+3)
CLI::wrap($descriptions[$i], 40, $maxlen + 3)
);
}

Expand Down
8 changes: 4 additions & 4 deletions user_guide_src/source/database/query_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,17 @@ searches.

$builder->like('title', 'match');
$builder->like('body', 'match');
// WHERE `title` LIKE '%match%' ESCAPE '!' AND `body` LIKE '%match% ESCAPE '!'
// WHERE `title` LIKE '%match%' ESCAPE '!' AND `body` LIKE '%match%' ESCAPE '!'

If you want to control where the wildcard (%) is placed, you can use
an optional third argument. Your options are 'before', 'after' and
'both' (which is the default).

::

$builder->like('title', 'match', 'before'); // Produces: WHERE `title` LIKE '%match' ESCAPE '!'
$builder->like('title', 'match', 'after'); // Produces: WHERE `title` LIKE 'match%' ESCAPE '!'
$builder->like('title', 'match', 'both'); // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'
$builder->like('title', 'match', 'before'); // Produces: WHERE `title` LIKE '%match' ESCAPE '!'
$builder->like('title', 'match', 'after'); // Produces: WHERE `title` LIKE 'match%' ESCAPE '!'
$builder->like('title', 'match', 'both'); // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'

#. **Associative array method:**

Expand Down
8 changes: 4 additions & 4 deletions user_guide_src/source/database/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ it returns the current row and moves the internal data pointer ahead.
You can optionally pass 'object' (default) or 'array' in order to specify
the returned value's type::

$query->getUnbufferedRow(); // object
$query->getUnbufferedRow('object'); // object
$query->getUnbufferedRow('array'); // associative array
$query->getUnbufferedRow(); // object
$query->getUnbufferedRow('object'); // object
$query->getUnbufferedRow('array'); // associative array

*********************
Custom Result Objects
Expand Down Expand Up @@ -251,7 +251,7 @@ Example::

if (isset($row))
{
echo $row->email; // access attributes
echo $row->email; // access attributes
echo $row->last_login('Y-m-d'); // access class methods
}

Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/extending/basecontroller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the public controllers and make ``AdminController`` for any administrative contr
If you do not want to use the base controller you may bypass it by having your controllers extend the system
Controller instead::

class Home extends Controller
class Home extends \CodeIgniter\Controller
{
}
4 changes: 2 additions & 2 deletions user_guide_src/source/extending/core_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ If you need to use a constructor in your class make sure you extend the parent c

<?php namespace App\Libraries;

use CodeIgniter\Router\RouteCollection;
use CodeIgniter\Router\RouteCollection as BaseRouteCollection;

class RouteCollection extends RouteCollection
class RouteCollection extends BaseRouteCollection
{
public function __construct()
{
Expand Down
8 changes: 4 additions & 4 deletions user_guide_src/source/helpers/text_helper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ The following functions are available:
Example::

$str = [
'question' => 'Is your name O\'reilly?',
'answer' => 'No, my name is O\'connor.'
'question' => "Is your name O\'reilly?",
'answer' => "No, my name is O\'connor."
];

$str = strip_slashes($str);
Expand Down Expand Up @@ -148,13 +148,13 @@ The following functions are available:
after each other. Example::

$string = "Fred, Bill,, Joe, Jimmy";
$string = reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
$string = reduce_multiples($string, ","); // results in "Fred, Bill, Joe, Jimmy"

If the third parameter is set to TRUE it will remove occurrences of the
character at the beginning and the end of the string. Example::

$string = ",Fred, Bill,, Joe, Jimmy,";
$string = reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
$string = reduce_multiples($string, ", ", TRUE); // results in "Fred, Bill, Joe, Jimmy"

.. php:function:: quotes_to_entities($str)
Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/libraries/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Similarly to flashdata, tempdata variables are managed internally by the
CodeIgniter session handler.

To mark an existing item as "tempdata", simply pass its key and expiry time
(in seconds!) to the ``mark_as_temp()`` method::
(in seconds!) to the ``markAsTempdata()`` method::

// 'item' will be erased after 300 seconds
$session->markAsTempdata('item', 300);
Expand All @@ -341,7 +341,7 @@ Or alternatively, using the ``setTempdata()`` method::

$session->setTempdata('item', 'value', 300);

You can also pass an array to ``set_tempdata()``::
You can also pass an array to ``setTempdata()``::

$tempdata = ['newuser' => TRUE, 'message' => 'Thanks for joining!'];
$session->setTempdata($tempdata, NULL, $expire);
Expand Down
10 changes: 5 additions & 5 deletions user_guide_src/source/libraries/uploaded_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ In controller::
}
}

where the **images** is loop is from the form field name
where the **images** is a loop from the form field name

If there are multiple files with the same name you can use ``getFile()`` ro retrieve every file individually::
In controller::
Expand Down Expand Up @@ -250,13 +250,13 @@ With the simplest usage, a single file might be submitted like::

<input type="file" name="userfile" />

By default, Upload files are saved in writable/uploads directory. the YYYYMMDD folder
and random file name will be created. return a file path::
By default, upload files are saved in writable/uploads directory. The YYYYMMDD folder
and random file name will be created. Returns a file path::

$path = $this->request->getFile('userfile')->store();

You can specify directory to movethe file to as the first parameter.a new filename by
passing it as thesecond parameter::
You can specify a directory to move the file to as the first parameter. A new filename by
passing it as the second parameter::

$path = $this->request->getFile('userfile')->store('head_img/', 'user_name.jpg');

Expand Down
8 changes: 4 additions & 4 deletions user_guide_src/source/outgoing/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ HTTP Caching
============

Built into the HTTP specification are tools help the client (often the web browser) cache the results. Used correctly,
this can lend a huge performance boost to your application because it will tell the client that they don't need
this can lead to a huge performance boost to your application because it will tell the client that they don't need
to contact the getServer at all since nothing has changed. And you can't get faster than that.

This are handled through the ``Cache-Control`` and ``ETag`` headers. This guide is not the proper place for a thorough
Expand All @@ -124,8 +124,8 @@ to set the Cache values to what you need, though, through the ``setCache()`` met

$options = [
'max-age' => 300,
's-maxage' => 900
'etag' => 'abcde',
's-maxage' => 900,
'etag' => 'abcde'
];
$this->response->setCache($options);

Expand Down Expand Up @@ -183,7 +183,7 @@ Runtime Configuration
If your application needs to make changes at run-time, you can access the instance at ``$response->CSP``. The
class holds a number of methods that map pretty clearly to the appropriate header value that you need to set.
Examples are shown below, with different combinations of parameters, though all accept either a directive
name or anarray of them.::
name or an array of them.::

// specify the default directive treatment
$response->CSP->reportOnly(false);
Expand Down
60 changes: 30 additions & 30 deletions user_guide_src/source/outgoing/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ method described in the function reference below).

$table = new \CodeIgniter\View\Table();

$data = array(
array('Name', 'Color', 'Size'),
array('Fred', 'Blue', 'Small'),
array('Mary', 'Red', 'Large'),
array('John', 'Green', 'Medium')
);
$data = [
['Name', 'Color', 'Size'],
['Fred', 'Blue', 'Small'],
['Mary', 'Red', 'Large'],
['John', 'Green', 'Medium'],
];

echo $table->generate($data);

Expand Down Expand Up @@ -91,38 +91,38 @@ The Table Class permits you to set a table template with which you can
specify the design of your layout. Here is the template prototype::

$template = [
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',

'thead_open' => '<thead>',
'thead_close' => '</thead>',
'thead_open' => '<thead>',
'thead_close' => '</thead>',

'heading_row_start' => '<tr>',
'heading_row_end' => '</tr>',
'heading_cell_start' => '<th>',
'heading_cell_end' => '</th>',
'heading_row_start' => '<tr>',
'heading_row_end' => '</tr>',
'heading_cell_start' => '<th>',
'heading_cell_end' => '</th>',

'tfoot_open' => '<tfoot>',
'tfoot_close' => '</tfoot>',
'tfoot_open' => '<tfoot>',
'tfoot_close' => '</tfoot>',

'footing_row_start' => '<tr>',
'footing_row_end' => '</tr>',
'footing_cell_start' => '<td>',
'footing_cell_end' => '</td>',
'footing_row_start' => '<tr>',
'footing_row_end' => '</tr>',
'footing_cell_start' => '<td>',
'footing_cell_end' => '</td>',

'tbody_open' => '<tbody>',
'tbody_close' => '</tbody>',
'tbody_open' => '<tbody>',
'tbody_close' => '</tbody>',

'row_start' => '<tr>',
'row_end' => '</tr>',
'cell_start' => '<td>',
'cell_end' => '</td>',
'row_start' => '<tr>',
'row_end' => '</tr>',
'cell_start' => '<td>',
'cell_end' => '</td>',

'row_alt_start' => '<tr>',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td>',
'cell_alt_end' => '</td>',
'row_alt_start' => '<tr>',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td>',
'cell_alt_end' => '</td>',

'table_close' => '</table>'
'table_close' => '</table>'
];

$table->setTemplate($template);
Expand Down
Loading

0 comments on commit 8b97001

Please sign in to comment.