framework/db/Query.php
public function from($tables)
    {
        if ($tables instanceof ExpressionInterface) {
            $tables = [$tables];
        }
        if (is_string($tables)) {
            $tables = preg_split('/\s*,\s*/', trim($tables), -1, PREG_SPLIT_NO_EMPTY);
        }
        $this->from = $tables;
        return $this;
    }
public function from($tables)
    {
        if ($tables instanceof ExpressionInterface) {
            $tables = [$tables];
        }
        if (is_string($tables)) {
            $tables = preg_split('/\s*,\s*/', trim($tables), -1, PREG_SPLIT_NO_EMPTY);
        }
        $this->from = $tables;
        return $this;
    }
Sets the FROM part of the query.
@param string|array|ExpressionInterface $tables the table(s) to be selected from. This can be either a string (e.g. `'user'`)
or an array (e.g. `['user', 'profile']`) specifying one or several table names.
Table names can contain schema prefixes (e.g. `'public.user'`) and/or table aliases (e.g. `'user u'`).
The method will automatically quote the table names unless it contains some parenthesis
(which means the table is given as a sub-query or DB expression).

When the tables are specified as an array, you may also use the array keys as the table aliases
(if a table does not need alias, do not use a string key).

Use a Query object to represent a sub-query. In this case, the corresponding array key will be used
as the alias for the sub-query.

To specify the `FROM` part in plain SQL, you may pass an instance of [[ExpressionInterface]].

Here are some examples:

```php
// SELECT * FROM  `user` `u`, `profile`;
$query = (new \yii\db\Query)->from(['u' => 'user', 'profile']);

// SELECT * FROM (SELECT * FROM `user` WHERE `active` = 1) `activeusers`;
$subquery = (new \yii\db\Query)->from('user')->where(['active' => true])
$query = (new \yii\db\Query)->from(['activeusers' => $subquery]);

// subquery can also be a string with plain SQL wrapped in parenthesis
// SELECT * FROM (SELECT * FROM `user` WHERE `active` = 1) `activeusers`;
$subquery = "(SELECT * FROM `user` WHERE `active` = 1)";
$query = (new \yii\db\Query)->from(['activeusers' => $subquery]);
```

@return $this the query object itself