-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added rm_string in text_helper #3465
Conversation
Allows to replaced specific keyword or fields from string.
Allows to removed specific keyword or fields from string
The initial issue was related to the validation, but it seems it can be solved with an existing rule. |
Add rm_string
please follow coding standard, you can run composer update and it will auto-fix in next commits when you make new changes. |
I'm not really sure if this functionality fits as a helper function. Basically it's a one-liner in a loop... Personally I'm not sold yet, but maybe you have some good use cases? Other things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalsn I changed the code. Maybe Now it is correct. Review it.
} | ||
return $string; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing close }
, also, again, please provide unit tests and follow coding style, do composer update and it will automatically fix it on next commit.
@samsonasik Soon I give a new PR . |
I just realized that we have https://codeigniter4.github.io/userguide/helpers/text_helper.html#word_censor |
@michalsn Yes the function word_censor is same as my expected. I have not see this function at before. Codeigniter have not route function in url helper, but codeigniter have site_url and base_url function.
If we didn't not assigned the url in router it's gives a exception. |
No worries, I forgot about this too. I just remembered it because you gave me your use case example. As for route thing. We have |
Allows to removed specific keyword or fields from string.
I added a new function rm_string in text helper. It will removed specific keywords or fields from given string.
I am not good at English, so I did not give huge description about it.
Thank You All.
Checklist: