Welcome Guest, Not a member yet? Register   Sign In
How to customize label on this codeigniter validation
#1

(This post was last modified: 04-10-2023, 10:47 PM by phili.)

There are more than 200 similar checks in my project:
if($this->request->getMethod() == 'post' && $this->validate([
            'category' => 'required',
            'title' => 'required|max_length[100]'
        ], [
            'title' => [
                'required' => 'No {field} provided'
            ]
        ]))

I only need to change the label. I tried like this:

if($this->request->getMethod() == 'post' && $this->validate([
            'category' => 'required',
            'title' => 'required|max_length[100]'
        ], [
            'title' => [
                'label' => 'Title'
            ]
        ]))

But it doesn't work! How to do this without rewriting a lot of code?
Reply


Messages In This Thread
How to customize label on this codeigniter validation - by phili - 04-10-2023, 10:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB