Where in the file system do you save your Exception definitions? |
Where should one store one's custom Exception definitions? I looked at app/Config/Exceptions.php but that doesn't seem like the spot for them.
I did have some luck storing one in app/Models/Exception_DB.php: PHP Code: <?php You can throw this exception like so: PHP Code: throw new \App\Models\Exception_DB("wtf"); However, that seems like maybe a weird place to put it? I previously put these exceptions in application/core in my CI3 project.
From what I read in the docs they should go into the folders that the exception is made for.
Model Views etc; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You can create an `app/Exceptions/` folder and have all exception classes live there. Then just call your own exception like
PHP Code: throw new \App\Exceptions\MyException(); |
Welcome Guest, Not a member yet? Register Sign In |