Getting "Expired token" errors ? Here is a solution to avoid invalid CSRF on POST or ajax requests, or user identity changes.
Getting "Expired token" errors ? Here is a solution to avoid invalid CSRF on POST or ajax requests, or user identity changes.
I have an API. It's built with a RESTful extension over Active Record, and some endpoints provide PUT methods to upload files. By a REST design we create an entity with POST /video
first, and then upload a video file with PUT /video/{id}/data
.
First of all, install yii2 basic template according below link:
As you know, events are used by:
OpenGraph and Twitter Cards are two metadata sets that allow to describe web pages and make it more understandable for Facebook and Twitter respectively.
Having said all of that, I want to add that the purpose of this article is not to convince anyone to write tests or design following TDD patterns. I'm not going to change the world to what I think is good. It's just about showing how to use some tools together with Yii Framework.
Logging is a very important feature of the application. It let's you know what is happening in every moment. By default, Yii2 basic and advanced application have just a \yii\log\FileTarget target configured.
Once you are completed with the "Creating First Yii Application", the following can be done.
Some PHP installations may use a different php.ini
file for CLI PHP (command line PHP parser). As a result, when running the model
or crud
command in yiic shell
, you may encounter errors like "YiiBase::include(PDO.php): failed to open stream..." or "...could not find driver", even though the requirement checker confirms you have PDO and the corresponding database driver.
Here is a way to dynamically extend tabs based on clips.
Probably even more complex things could be done.
Missed of autocomplete in bash console commands yii make me sad.
some when you need to add checkbox in cgridview and change state of selected rows by additianal parameters. in view :
This behavior will automatically set timestamp fields to the row creation and modification times.
The Yii Framework provides a sweet functionality that allows you to easily create page specific menus. What does this mean? This allows you to create one layout or CSS styling for your menu, and when each page is loaded, a new set of menu items is loaded in. This is useful for context specific sidebars within your application.
I am going to show you an effective way to validate the uniqueness of multiple columns.
When building PHP web applications you usually have to take care about defining and providing a consistent development and production environment for your team. This includes your application packages, PHP-extensions, database servers and often further components such as a mail server or workers.