Skip to content

Instantly share code, notes, and snippets.

View r3verser's full-sized avatar
💭
🚀 👾 🛰️

r3verser

💭
🚀 👾 🛰️
View GitHub Profile
MIT License
Copyright (c) 2014-present Artem Voitko
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
@r3verser
r3verser / AccessBehavior.php
Last active December 7, 2022 08:22
Yii2 Redirects all users to login (or any) page if not logged in, but allow access to some pages (like signup, password recovery etc.)
<?php
/*
* In configuration file
* ...
* 'as AccessBehavior' => [
* 'class' => 'app\components\AccessBehavior',
* 'allowedRoutes' => [
* '/',
* ['/user/registration/register'],
@r3verser
r3verser / SluggableBehavior.php
Last active August 29, 2015 14:08
Yii2 Upgraded SluggableBehavior with options: moved to https://github.com/r3verser/yii2-SluggableBehavior
We couldn’t find that file to show.
@r3verser
r3verser / AccessBehavior.php
Created October 18, 2014 15:08
Yii2 Redirects all users to login page if not logged in
<?php
/*
* In configuration file
* ...
* 'as AccessBehavior' => [
* 'class' => '\app\components\AccessBehavior'
* ]
* ...
* (c) Artem Voitko <[email protected]>