PHP: Calling a user-defined function inside constructor? -
i have class userauth
inside constructor have added code check user valid or not, if there no value in session check cookies (as part of "remember me" feature), if there value inside cookies call function confirmuser
check authenticity database. on basis of value returned confirmuser function returning bool (true or fales) value in constructor.
i have created class as:
<?php class userauth { function userauth(){ //code } function confirmuser($username, $password){ //code } } $signin_user = new userauth(); ?>
confirmuser
function take 2 string type parameters , return return integer value of 0, 1, 2.
i can't add code of confirmuser
function inside constructor using function @ more places in application.
so, want know how call user-defined function inside constructor in php. please help.
thanks!
$this->nameoffunction()
but when in class, called methods.
Comments
Post a Comment