namespace app\components;
namespace app\components;
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's very important to know how the Eager Loading approach works in Yii 2. It has changed drastically from that of Yii 1.1, and there are common misunderstandings about it in the community.
A Yii Framework 2 component for using assets in different environments (Local/CDNs)
I just chased my tail around for a bit today. I got lost with setting the status of all inputs, and banging my head on why the "validate" function just wasn't working.
This tutorial describes how to connect to a remote service via tunnel when only most basic software is available on the remote server. It is not directly related to Yii. It could be hovewer useful for web developers working with shared hosting sites with limited access.
I have been working on a REST API using the excellent tools provided by Yii2. My problem was that I have to differentiate between empty values and null values. In other words, <elem></elem>
is different from null as it represents an empty string. Also, although some use <elem/>
to represent a null value it should still be interpreted as an empty string. In other cases, the absence of the eleme...
Small companies and startups use cheap email services or even Cpanel's mail services which are less secure and compete directly with bigger email providers like Microsoft with Outlook and Google with Gmail. This creates a problem when you try to use their services to send/receive emails from this cheap services. <img width="750" src="https://static.techspot.com/fileshost/newspics3/2017/google-clo...
You have different collections in MongoDb with de-normalized attributes. As you may know, due to its not-join nature, MongoDb tends to encourage repetition of the same value in different collections (de-normalization). In this MongoDb is opposed to a more SQL-like approach where you usually reference only the ID of the value with a foreign key.
Personalmente trovo che la versione "portable" sia molto più semplice da aggiornare, ed io tengo sempre costantemente aggiornato TUTTO il parco software relativo al mio webserver.
Yii2 introduces the BootstrapInterface to ease our application initialization tasks, whether they are composer
based or Application bootstrap (do not mistaken with Bootstrap CSS Framework) based tasks. On this article, I am going to explain how to use it on y...
composer update
does not fetch any new packages (even though the source is updated)composer update
.composer update
earlier, but it was partially done, before you lost network connectivity, and you cannot refresh packages anymore.In Yii1 I used to have my own components under the components folder of the structure, now with namespacing this is a little bit different.
Note the tag {{homeUrl}}
will be dynamically replaced at runtime.
Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock
file in your application root folder.
The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?
The yii2-datecontrol extension allows you to control separate date formats for display and saving for form inputs.
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.
You have a 'Category' model with Id, Name and Visibility (boolean, where 0 = Public, and 1 = Private).