Download the PHP package svyatov/yii-shortcut without Composer
On this page you can find all versions of the php package svyatov/yii-shortcut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii-shortcut
Y
Shortcuts for Yii framework v1.1
Install
via Composer (recommended)
php composer.phar require svyatov/yii-shortcut '~2.0'
via download
Get the latest release and put Y.php
file in your application protected/components
folder.
Usage
Creating URL by route in a widget
Get/set some cache value
The same with cookies
Getting the value of CSRF token
Inserting CSRF name and token in some jQuery request
Quick variable dump with code highlighting
Short action ending without template rendering (e.g. for AJAX requests)
Redirects
Detecting current user status (is he a guest or is he authenticated)
As you can see, the amount of code becomes at least 2 times smaller. So you need to type at least 2 times less and you can read it and understand it at least 2 times faster.
Changelog
-
v2.0.0 / 26.08.2014
new
Added new methods: module() and component().chg
Removed protected method _getComponent().chg
Removed method getRequest().chg
Protected method _getValueByComplexKeyFromArray() renamed to getValueByComplexKeyFromArray() and changed to public.chg
Methods getGet(), getPost() and getFiles() renamed to GET(), POST() and FILES() respectively.chg
Method isAuthed() renamed to isAuthenticated().chg
Method redir() renamed to redirect().chg
Method flashRedir() renamed to flashAndRedirect().chg
Methods redirAuthed() and redirGuest() renamed to redirectIfAuthenticated() and redirectIfGuest() respectively.chg
Method hasAccess() renamed to checkAccess().chg
Setters, getters and deleters for cache, cookie and session renamed to comply common pattern, e.g.: cacheSet() -> setCache(). -
v1.3.2 / 05.05.2014
fix
Composer autoloading fixed.chg
Scope of _getComponent() and _getValueByComplexKeyFromArray() methods changed to protected.chg
README.md enhanced and style updated.chg
phpDoc comments light reformat. -
v1.3.1 / 28.09.2013
fix
Fixed urls to repo. No code changed. -
v1.3.0 / 12.07.2013
new
Everything is translated to English.new
Added LICENSE file.chg
Updated composer.json file.chg
Added second argument $options to cookieDelete() method.chg
Added $secure and $httpOnly arguments to cookieSet() method. Besides, $value argument could be an instance of CHttpCookie class now.chg
CSRF token name in method csrfJsParam() now quoted.chg
Default $message argument value in flash() method changed to 'false' so now there is a way to remove flash message by passing 'null' as $message argument.chg
Added $params and $allowCaching arguments to hasAccess() method. It doesn't change previous behaviour but extending method abilities.chg
Code refactoring. -
v1.2.1 / 25.01.2012
new
Added method getFile(). -
v1.2.0 / 20.10.2011
new
Added methods: format, script, session, sessionGet, sessionSet, sessionDelete.new
Added internal caching of application components.chg
cookieDelete() method now returns the object of removed cookie (like the original method). -
v1.1.5 / 29.09.2011
new
Added method dbCmd().fix
Fixed errors in @since phpDoc tags. -
v1.1.4 / 27.09.2011
fix
Fixed bug in cookieSet() method, which prevents setting cookie if there was no $expire argument.chg
Cookie methods now use native methods of the CCookieCollection class. -
v1.1.3 / 19.07.2011
new
Added methods: getGet, getPost, getRequest, getPdo, hasFlash.chg
cache(), cacheDelete(), cacheGet(), cacheSet() methods now have $cacheId argument, which gives the ability to select different cache backends.chg
Added $options argument to endJson() method, which gives the ability to pass options to native json_encode() function.chg
More "magic" removed. Code refactoring. -
v1.1.0 / 29.05.2011
new
Added methods: isAjaxRequest, isPutRequest, isDeleteRequest, isPostRequest, isSecureConnection.new
Added changelog to README. README.markdown renamed to README.mdchg
Removed almost every "magic" inside methods.chg
Added $absolute argument to baseUrl() method, which gives the ability to get absolute URL instead of relative one.chg
Added $default argument to cookieGet() method, which gives the ability to return value of $default variable if cookie with specified name doesn't exist.chg
Added $default argument to param() method, which gives the ability to return value of $default variable if parameter with specified name doesn't exist. Also, method code refactored.chg
Fixed and enhanced phpDoc comments. -
v1.0.4 / 05.01.2011
chg
Code refactoring. Class uploaded to GitHub. -
v1.0.3 / 16.12.2010
fix
Fixed bug in param() method. -
v1.0.2 / 16.12.2010
new
Added method hasAccess().new
Enhanced method param(). Now key could contain dot delimited string to access nested variables. For example: 'site.title' returns value at param['site']['title']. Thanks for idea to sergebezborodov.chg
Code refactoring.