This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Selective validation behavior | |
* | |
* @copyright ADmad | |
* @link https://github.com/ADmad | |
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | |
*/ | |
class SelectiveValidationBehavior extends ModelBehavior { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('DispatcherFilter', 'Routing'); | |
class CorsFilter extends DispatcherFilter { | |
public function beforeDispatch(CakeEvent $event) { | |
if ($event->data['request']->is('OPTIONS')) { | |
$event->stopPropagation(); | |
$event->data['response']->header(array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/stickyStateProvider.js b/src/stickyStateProvider.js | |
index 800c16a..1d89f09 100644 | |
--- a/src/stickyStateProvider.js | |
+++ b/src/stickyStateProvider.js | |
@@ -109,6 +109,16 @@ function $StickyStateProvider($stateProvider) { | |
}); | |
return states; | |
}, | |
+ clearInactiveState: function (name) { | |
+ var state = inactiveStates[name]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Model\Behavior; | |
use Cake\ORM\Behavior; | |
use Cake\ORM\Query; | |
use Cake\Utility\Hash; | |
class MetaBehavior extends Behavior | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Don't automatically add "prefix" to urls | |
Router::addUrlFilter(function ($params, $request) { | |
if (!isset($params['_name']) && !array_key_exists('prefix', $params)) { | |
$params['prefix'] = false; | |
} | |
return $params; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Hash', 'Utility'); | |
/** | |
* Translation behavior. | |
* | |
* @license MIT | |
* @url http://code.google.com/p/alkemann | |
* @author Alexander Morland aka alkemann | |
* @author Ronny Vindenes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Posts hasMany Images | |
// Posts hasOne FeaturedImages: where featured image is the first image for that post. | |
$this->hasOne('FeaturedImages', [ | |
'className' => 'Images', | |
'foreignKey' => false, | |
'conditions' => function ($exp, $query) { | |
$subquery = $query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\View\Helper; | |
use AssetCompress\View\Helper\AssetCompressHelper as BaseHelper; | |
use Cake\Core\Configure; | |
class AssetCompressHelper extends BaseHelper | |
{ | |
public function css($file, $options = []) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Error\Middleware; | |
use Cake\Error\Middleware\ErrorHandlerMiddleware as CoreErrorHandlerMiddleware; | |
use Zend\Diactoros\Response\RedirectResponse; | |
/** | |
* Error handling middleware. | |
* | |
* Checks for old urls and 301 redirects to corresonding new ones. |
OlderNewer