-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Extending IonAuth from the third party folder on Codeigniter4 #1546
Comments
You should be able to create a new library that extends the one in ThirdParty, then include that in your controller instead. |
class Tzilacatzin extends \CodeIgniter\Controller
{
public $IonAuth = null;
public function __construct(){
$this->IonAuth = service('ionauth');
}
class Services extends BaseService
{
public static function ionauth(IonAuth $config = null,$getShared = true)
{
if ($getShared){
return static::getSharedInstance('ionauth',$config);
}
return new \App\ThirdParty\IonAuth\IonAuth();
}
}
[image: image.png]
YOU CAN CREATE A SERVICE
El mié, 19 ene 2022 a la(s) 13:34, Ben Edmunds ***@***.***)
escribió:
… You should be able to create a new library that extends the one in
ThirdParty, then include that in your controller instead.
—
Reply to this email directly, view it on GitHub
<#1546 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBZA7HIYOWZRPFCEX4Y5MLUW4G25ANCNFSM5MCBRMHQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks @benedmunds and @junglaCODE, but that doesn't really get to the bottom of it. I am on v4 ionAuth ansd v4 Codeigniter. I can get the controller to work (and sit in the app/controllers folder) with the code below. But I cannot seem do they same for the library, model, language files etc. What am I missing?
etc |
Can you zip up an example project with what you’ve tried. You can email it to me at ben.edmunds at gmail |
Hi, follow the steps below carefully. Step 2: Go to path
Step 3: Importe the tables manually(by phpmyadmin) in the database or use the following command: Step 4: Go to path
NOTE: By doing this(Step 4) you can specify the view folder and validationListTemplate for be customized.Just specify the path. For example change
entering address yoursite.com/Yorcontroller A new profile user is now created.
@internetics Enjoy Enjoy and Enjoy. |
Thanks @datamweb . But as you can see in my code above yours I already have extended the Auth controller, and I have specified where the views are with:
BUT what I really need to know is how to extend the languages folder and files, specify a new model, library etc etc - how can I get ionAuth to see my new files? NOT just the controller and view files. @benedmunds I won't be able to send on my files, but I am hoping this request is simple enough! Thanks for your help all! |
I do not know if I understood what you meant correctly or not, because English is not good.
To extend from your model file, you need to copy file app\ThirdParty\CodeIgniter-Ion-Auth-4.0.3\Models\IonAuthModel.php and put it in path app\Models\IonAuthModel.php .Then apply the following changes:
And ... |
I have IonAuth running in the ThirdParty folder on Codeigniter4. I have extended the controller, in that I have Auth.php running in my app/Controllers directory and that is working.
How can I extend the IonAuth library, the model and the language files etc? These files get ignored, unlike the Auth.php controller. I don't want to edit the files in the ThirdParty folder, to make it easier to upgrade etc. Thanks.
The text was updated successfully, but these errors were encountered: