Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve helpers #8294

Merged
merged 13 commits into from
Dec 6, 2023
Merged

docs: improve helpers #8294

merged 13 commits into from
Dec 6, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Dec 6, 2023

Description
From https://forum.codeigniter.com/showthread.php?tid=88591&pid=414184#pid414184

  • improve descriptions

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Dec 6, 2023
Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explanation is good.
But what makes documents simple and fluent is the existence of examples in the document. I think creating a title with "creating custom helper" and a simple example is good for improving the documentation.

<?php
// app/Helpers/info_helper.php
use CodeIgniter\CodeIgniter;

if (!function_exists('getVer')) {

    function getVer()
    {
        return CodeIgniter::CI_VERSION;
    }
}

Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's clear to me how you can create a helper

@kenjis
Copy link
Member Author

kenjis commented Dec 6, 2023

Added a custom helper code.

*/
function ci_version(): string
{
return CodeIgniter::CI_VERSION;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return CodeIgniter::CI_VERSION;
return CodeIgniter\CodeIgniter::CI_VERSION;

OR use CodeIgniter\CodeIgniter;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kenjis.

@kenjis kenjis merged commit 29f7199 into codeigniter4:develop Dec 6, 2023
7 checks passed
@kenjis kenjis deleted the docs-helpers branch December 6, 2023 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants