PHP code example of stanislav-web / phalcon-ulogin
1. Go to this page and download the library: Download stanislav-web/phalcon-ulogin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stanislav-web / phalcon-ulogin example snippets
$loader->registerNamespaces([
'ULogin\Auth' => 'path to src'
]);
$this->di['ulogin'] = function() {
return new ULogin\Auth();
};
use ULogin\Auth;
echo (new Auth())->getForm();
echo (new Auth())->setType('window')->getForm(); // window, panel, small as default
echo (new Auth())->setProviders([
'vkontakte' => true, // show inline
'odnoklassniki' => true, // show inline
'facebook' => false, // show in drop down
'google' => false, // show in drop down
'yandex' => true, // show inline
])->setType('panel')->getForm();
echo (new Auth())->setProviders('vkontakte=true,odnoklassniki=true,facebook=false,google=false,yandex=true')->setType('panel')->getForm();
echo (new Auth())->setType('panel')->setUrl('?success')->getForm();
echo (new Auth())->setFields([
'first_name',
'last_name',
'photo',
'city'
])->getForm();
echo (new Auth())->setFields('first_name,last_name,photo,city')->getForm();