This repository contains the code for the Yii 3 demo projects: https://demo.yiiframework.com
docker-compose run certbot
docker-compose restart gateway
Yii 3 demo application
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
This repository contains the code for the Yii 3 demo projects: https://demo.yiiframework.com
docker-compose run certbot
docker-compose restart gateway
I think it is good practice to use interfaces for repositories.
Repository methods already return DataReaderInterface
objects (this gives us independence from DBAL), it remains only to describe their API in the interfaces.
Recently I installed the latest development version from composer with composer create-project --prefer-dist --stability=dev yiisoft/yii-demo app
command. I got this error when running "vendor/bin/yii" serve
PHP Notice: Undefined index: container in D:\Project\app\vendor\yiisoft\yii-console\bin\yii on line 43
Notice: Undefined index: container in D:\Project\app\vendor\yiisoft\yii-console\bin\yii on line 43
PHP Fatal error: Uncaught Error: Function name must be a string in D:\Project\app\vendor\yiisoft\yii-console\bin\yii:43
Stack trace:
#0 D:\Project\app\vendor\yiisoft\yii-console\bin\yii(46): {closure}()
#1 {main}
thrown in D:\Project\app\vendor\yiisoft\yii-console\bin\yii on line 43
Fatal error: Uncaught Error: Function name must be a string in D:\Project\app\vendor\yiisoft\yii-console\bin\yii:43
Stack trace:
#0 D:\Project\app\vendor\yiisoft\yii-console\bin\yii(46): {closure}()
#1 {main}
thrown in D:\Project\app\vendor\yiisoft\yii-console\bin\yii on line 43
After that, I tried to run on Apache2, this is my apache configuration
<VirtualHost *:80>
DocumentRoot "D:\Project\app\public"
ServerName yii.test.local
<Directory "D:\Project\app\public">
Options Indexes FollowSymLinks Includes ExecCGI
#Options FollowSymLinks Multiviews Indexes
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
I got this error
Fatal error: Uncaught InvalidArgumentException: Invalid path alias: @runtime/logs/app.log in D:\Project\app\vendor\yiisoft\aliases\src\Aliases.php:141 Stack trace: #0 D:\Project\app\src\Factory\LoggerFactory.php(17): Yiisoft\Aliases\Aliases->get('@runtime/logs/a...') #1 D:\Project\app\vendor\yiisoft\factory\src\Definitions\CallableDefinition.php(19): App\Factory\LoggerFactory->__invoke(Object(Yiisoft\Di\Container)) #2 D:\Project\app\vendor\yiisoft\di\src\Container.php(214): Yiisoft\Factory\Definitions\CallableDefinition->resolve(Object(Yiisoft\Di\Container)) #3 D:\Project\app\vendor\yiisoft\di\src\Container.php(155): Yiisoft\Di\Container->buildInternal('Psr\\Log\\LoggerI...') #4 D:\Project\app\vendor\yiisoft\di\src\Container.php(88): Yiisoft\Di\Container->build('Psr\\Log\\LoggerI...') #5 D:\Project\app\vendor\yiisoft\factory\src\Definitions\ClassDefinition.php(36): Yiisoft\Di\Container->get('Psr\\Log\\LoggerI...') #6 D:\Project\app\vendor\yiis in D:\Project\app\vendor\yiisoft\aliases\src\Aliases.php on line 141
I tried to run composer dump-autoload
, and got this error when running on browser
Fatal error: Uncaught RuntimeException: Alias of the root directory is not defined. in D:\Project\app\runtime\build\config\web.php:58 Stack trace: #0 D:\Project\app\vendor\yiisoft\factory\src\Definitions\CallableDefinition.php(19): {closure}(Object(Yiisoft\Di\CompositeContainer)) #1 D:\Project\app\vendor\yiisoft\di\src\Container.php(214): Yiisoft\Factory\Definitions\CallableDefinition->resolve(Object(Yiisoft\Di\CompositeContainer)) #2 D:\Project\app\vendor\yiisoft\di\src\Container.php(155): Yiisoft\Di\Container->buildInternal('Yiisoft\\Yii\\Fil...') #3 D:\Project\app\vendor\yiisoft\di\src\Container.php(88): Yiisoft\Di\Container->build('Yiisoft\\Yii\\Fil...') #4 D:\Project\app\vendor\yiisoft\yii-debug\src\Proxy\ContainerInterfaceProxy.php(171): Yiisoft\Di\Container->get('Yiisoft\\Yii\\Fil...') #5 D:\Project\app\vendor\yiisoft\yii-debug\src\Proxy\ContainerInterfaceProxy.php(56): Yiisoft\Yii\Debug\Proxy\ContainerInterfaceProxy->getInstance('Yiisoft\\Yii\\F in D:\Project\app\runtime\build\config\web.php on line 58
Do I have a mistake when configuring?
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4.4 |
Operating system | Windows 10 |
This is not a library and most of the changes relates to specific package versions/commits so commit composer.lock
, package-lock.json
and yarn.lock
would be ok
See https://github.com/yiisoft/yii-demo/pull/57/files (was rolled back) and hiqdev/composer-config-plugin#51
./vendor/bin/yii fixture/add
[OK] Done
[ERROR] Typed property App\Blog\Entity\Post::$content must not be accessed before initialization
Now in ViewRenderer added parameter "csrf" to all views and added parameter "user" to layout.
For add another parameters (for example, add "canonicalLink" or Facebook Open Graph Markup parameters to layout) need modify ViewRenderer class. This is not good, this is overload of class.
Need find way remove adding parameters from VeiwRenderer class.
i have done to setup on web server in this case i use apache2
my API can run on another domain
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4.7 |
Operating system | Ubuntu 18.04 |
Hi @samdark,
I realise yii3 isnt finished yet and is subject to change, but I was wondering if there was an agreed project layout to use as of yet? Is it something like this project structure or should I be using the structure similar to yii2 found here https://github.com/yiisoft/yii-base-web
yii-base-web looks more familiar to me - but yii-demo is a pinned repo and has recent commits (suggesting that is the one to use).
Being Jan 2020 I thought I would take the plunge with yii3 as its nearing release - but want to make sure I start on the right path...
Expected to log in. Got CSRF protection responding with "Unprocessable entity".
First of all it is not obvious where Aliases
is coming from, I mean when doing $container->get(Aliases::class)
. As I've checked I see that it is configured in yii-web
di container, but I think it is not obvious and we still need to add it to yii-demo
s common config (actually that config is supposed to be in base template, but as I understand yii-web
is not a template and yii-demo
is just a demo showing yii3 for the time being).
Now when I add Aliases
config to this projects common config:
Aliases::class => [
'__class' => Aliases::class,
'__construct' => [$params['aliases']],
],
I get wrong config built by composer-config-plugin
, the config built looks like this in runtime directory:
'Yiisoft\\Aliases\\Aliases' => [
'__class' => 'Yiisoft\\Aliases\\Aliases',
'__construct()' => [
[
'@root' => 'D:\\dev\\php\\tuninfo',
'@vendor' => '@root/vendor',
'@public' => '@root/public',
'@runtime' => '@root/runtime',
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@web' => '/',
],
],
'__construct' => [
[
'@root' => 'D:\\dev\\php\\tuninfo',
'@vendor' => '@root/vendor',
'@public' => '@root/public',
'@runtime' => '@root/runtime',
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@web' => '/',
],
],
],
and I get following error Argument 2 passed to Yiisoft\Aliases\Aliases::__set() must be of the type string, array given in vendor\yiisoft\aliases\src\Aliases.php on line 27
.
As the point 1 refers to this project I've opened the issue here, though I see that the wrong config is the issue in composer-config-plugin
.
hi.
The following error is displayed when composer update:
[hiqdev\composer\config\exceptions\FailedReadException] failed read file: /app/vendor/yiisoft/view/config/common.php
Q | A |
---|---|
Version | yii3, master branch |
PHP version | 7.4 |
Operating system | linux, ubuntu 18.04 |
Transfer console entry point (vendor/bin/yii) from yiisoft/yii-console to yiisoft/yii-demo and yiisoft/app
I just begin to read the demo code , for select a better framework.
run the code work well, show the result ok.
Tracing code at src/Blog/BlogController
public function index(Request $request, ORMInterface $orm, ArchiveRepository $archiveRepo): Response
{
var_dump(get_class($orm)); // => Cycle\ORM\ORM
/** @var PostRepository $postRepo */
$postRepo = $orm->getRepository(Post::class);
debug_print_backtrace(2);
//...
}
what the $orm come from ? can I have other way to get it.
like $orm = App::GetOrm();
and where the code is $orm object init ?
i want to that what my object is decleare explict.
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4.4 |
Operating system | wsl1-debian |
Error on path /blog/archive/
Argument 1 passed to App\Blog\Archive\ArchiveRepository::getYearlyArchive() must be of the type int, string given, called in /app/src/Blog/Archive/ArchiveController.php on line 56
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4 |
Operating system | Docker |
JQ已经是过去时代 期待希望3.0给我们惊艳,更易于和Vue 或 react 现代前端框架 结合
Using render
function to render content of view file looks too hard.
Instead of return the result of render
function we should to create response before and write data after.
Let's delegate creating the Response
object to render
function.
User controllers will be more simpler and cleaner
public function index(): Response
{
return $this->render('index');
}
public function index(): Response
{
$output = $this->render('index');
$response = $this->responseFactory->createResponse();
$response->getBody()->write($output);
return $response;
}
After installing the project in dev mode and running web server:
composer create-project --stability=dev --prefer-dist yiisoft/yii-demo myapp
cd myapp/public
php -S 0.0.0.0:8080
I got an exception:
Uncaught Yiisoft\Factory\Exceptions\NotFoundException: No definition for Psr\Log\LoggerInterface in /home/maximal/project/myapp/vendor/yiisoft/di/src/Container.php:134
Stack trace:
#0 /home/maximal/project/myapp/vendor/yiisoft/di/src/Container.php(120): Yiisoft\Di\Container->buildPrimitive('Psr\\Log\\LoggerI...', Array)
#1 /home/maximal/project/myapp/vendor/yiisoft/di/src/Container.php(111): Yiisoft\Di\Container->buildInternal('Psr\\Log\\LoggerI...', Array)
#2 /home/maximal/project/myapp/vendor/yiisoft/di/src/Container.php(79): Yiisoft\Di\Container->build('Psr\\Log\\LoggerI...', Array)
#3 /home/maximal/project/myapp/vendor/yiisoft/factory/src/Definitions/ClassDefinition.php(31): Yiisoft\Di\Container->get('Psr\\Log\\LoggerI...')
#4 /home/maximal/project/myapp/vendor/yiisoft/factory/src/Definitions/ArrayBuilder.php(63): Yiisoft\Factory\Definitions\ClassDefinition->resolve(Object(Yiisoft\Di\Container))
#5 /home/maximal/project/myapp/vendor/yiisoft/factory/src/Definitions/ArrayBuilder.php(47): Yiisoft\Factory\Def in /home/maximal/project/myapp/vendor/yiisoft/di/src/Container.php on line 134
Tried to dig into Container
and ArrayBuilder
classes but nothing worked out.
How can I run demo web app?
Steps from the guide (https://github.com/yiisoft/docs/blob/master/guide/en/start/installation.md):
composer create-project --prefer-dist --stability=dev yiisoft/yii-demo yii3-app
cd yii3-app/public
../vendor/bin/yii serve
Web server started
PHP Fatal error: Uncaught ReflectionException: Class commands does not exist in /vagrant/yii3-app/vendor/yiisoft/factory/src/Resolvers/ClassNameResolver.php:22
Stack trace:
#0 /vagrant/yii3-app/vendor/yiisoft/factory/src/Resolvers/ClassNameResolver.php(22): ReflectionClass->__construct('commands')
#1 /vagrant/yii3-app/vendor/yiisoft/factory/src/Definitions/ArrayBuilder.php(78): Yiisoft\Factory\Resolvers\ClassNameResolver->resolveConstructor('commands')
#2 /vagrant/yii3-app/vendor/yiisoft/factory/src/Definitions/ArrayBuilder.php(18): Yiisoft\Factory\Definitions\ArrayBuilder->getDependencies('commands')
#3 /vagrant/yii3-app/vendor/yiisoft/factory/src/Definitions/ArrayDefinition.php(74): Yiisoft\Factory\Definitions\ArrayBuilder->build(Object(Yiisoft\Di\Container), Object(Yiisoft\Factory\Definitions\ArrayDefinition))
#4 /vagrant/yii3-app/vendor/yiisoft/di/src/Container.php(123): Yiisoft\Factory\Definitions\ArrayDefinition->resolve(Object(Yiisoft\Di\Container), Array)
#5 /vagrant/yii3-app/vendor/yiisoft/di/src/Container.php(111): in /vagrant/yii3-app/vendor/yiisoft/factory/src/Resolvers/ClassNameResolver.php on line 22
Q | A |
---|---|
Version | dev |
PHP version | 7.3 |
Operating system | Ubuntu 18.04 |
Hi
In the current structure, the models have been removed and replaced by repositories.
I think models should exist and do functional actions on repositories.
In this method, the Repository contain basic functions (such as finaAll , findOne, etc.) and the Model have the controller required functions.
Repository Example:
class UserRepository extends ...
{
public function findAll(array $scope = [], array $orderBy = []): DataReaderInterface
{
return new SelectDataReader($this->select()->where($scope)->orderBy($orderBy));
}
private function findIdentityBy(string $field, string $value): ?IdentityInterface
{
return $this->findOne([$field => $value]);
}
public function findIdentity(string $id): ?IdentityInterface
{
return $this->findByPK($id);
}
public function findIdentityByToken(string $token, string $type = null): ?IdentityInterface
{
return $this->findIdentityBy('token', $token);
}
public function findByLogin(string $login): ?IdentityInterface
{
return $this->findIdentityBy('login', $login);
}
}
Model Example:
class User extends Model
{
public function search(array $params = [],UserRepository $userRepository)
{
$dataReader = $userRepository->findAll()->withSort((new Sort([]))->withOrderString('login'));
$paginator = (new OffsetPaginator($dataReader))
->withPageSize(self::PAGINATION_INDEX)
->withCurrentPage($pageNum);
return $paginator;
}
public function signup(...)
{
//validate
//create user record
//create user profile
}
public function ActiveUser(...)
{
}
}
Clone the demo project, run composer install and open it through web server (apache).
Functional demo project.
PHP Fatal error: Uncaught Error: Class 'Yiisoft\Router\FastRoute\FastRouteFactory' not found in /var/www/html/yii-demo-master/src/Factory/AppRouterFactory.php:71\nStack trace:\n#0 /var/www/html/yii-demo-master/vendor/yiisoft/factory/src/Definitions/CallableDefinition.php(19): App\Factory\AppRouterFactory->__invoke()\n#1 /var/www/html/yii-demo-master/vendor/yiisoft/di/src/Container.php(134): Yiisoft\Factory\Definitions\CallableDefinition->resolve()\n#2 /var/www/html/yii-demo-master/vendor/yiisoft/di/src/Container.php(114): Yiisoft\Di\Container->buildInternal()\n#3 /var/www/html/yii-demo-master/vendor/yiisoft/di/src/Container.php(80): Yiisoft\Di\Container->build()\n#4 /var/www/html/yii-demo-master/vendor/yiisoft/factory/src/Definitions/Reference.php(44): Yiisoft\Di\Container->get()\n#5 /var/www/html/yii-demo-master/vendor/yiisoft/di/src/Container.php(134): Yiisoft\Factory\Definitions\Reference->resolve()\n#6 /var/www/html/yii-demo-master/vendor/yiisoft/di/src/Container.php(114): Yiisoft\Di\Container->buildInternal()\n#7 /var/www/html/yi in /var/www/html/yii-demo-master/src/Factory/AppRouterFactory.php on line 71
Q | A |
---|---|
Version | 1.0.? |
PHP version | |
Operating system |
AccessChecker is session dependent
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4 |
Operating system | Docker |
The documentation says
The application installed according to the above instructions should work out of the box with either an Apache HTTP server or an Nginx HTTP server
Steps from the guide (https://github.com/yiisoft/docs/blob/master/guide/en/start/installation.md):
cd /var/www/html
composer create-project --prefer-dist --stability=dev yiisoft/yii-demo yii3-app
Apache virtualhost DocumentRoot
is /var/www/html
Go to http://server-name.test/yii3-app/public/
You will see We were unable to find the page /yii3-app/public/.
Work out of the box
We were unable to find the page /yii3-app/public/.
If a separate virtual host is configured for the app as explained further in the documentation it works as expected.
Q | A |
---|---|
Version | dev |
PHP version | 7.3 |
Operating system | Ubuntu 18.04 |
Parameters should be used to configure services and should not be accessed directly.
https://github.com/yiisoft/yii-demo/blob/master/src/Parameters.php should be eliminated.
Hi,
not sure where to ask - so just shortly here:
I did apache bench on yii3 (demo) against yii2 (basic app) and got extremly poor results for yii3:
Using latest version of yii3 dev (composer update), PHP 7.4.1.
bench results here (must have switched to -n 1
due to extremly slow response):
d:\wamp\bin\apache\apache2.4.37\bin>ab -n 1 -c 1 127.0.0.1/yii3/yii-demo/public/index.php
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient).....done
Server Software: Apache/2.4.37
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /yii3/yii-demo/public/index.php
Document Length: 43 bytes
Concurrency Level: 1
Time taken for tests: 5.987 seconds
Complete requests: 1
Failed requests: 0
Non-2xx responses: 1
Total transferred: 344 bytes
HTML transferred: 43 bytes
Requests per second: 0.18 [#/sec] (mean) <- why? edit: found reason: 404 timeout
Time per request: 5986.504 [ms] (mean)
Time per request: 5986.504 [ms] (mean, across all concurrent requests)
Transfer rate: 0.06 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 5987 5987 0.0 5987 5987
Waiting: 687 687 0.0 687 687
Total: 5987 5987 0.0 5987 5987
Is there anything special to configure for yii3 demo CLI environment .. ?
In HTTP mode yii3 demo works all OK.
As for yii2 results are OK on the same setup:
d:\wamp\bin\apache\apache2.4.37\bin>ab -n 1000 -c 1 127.0.0.1/yii2/basic/web/index.php
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache/2.4.37
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /yii2/basic/web/index.php
Document Length: 65901 bytes
Concurrency Level: 1
Time taken for tests: 6.571 seconds
Complete requests: 1000
Failed requests: 0
Non-2xx responses: 1000
Total transferred: 66116000 bytes
HTML transferred: 65901000 bytes
Requests per second: 152.20 [#/sec] (mean)
Time per request: 6.571 [ms] (mean)
Time per request: 6.571 [ms] (mean, across all concurrent requests)
Transfer rate: 9826.70 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.3 0 10
Processing: 0 6 4.7 9 16
Waiting: 0 6 4.7 7 16
Total: 0 6 4.8 10 16
Percentage of the requests served within a certain time (ms)
50% 10
66% 10
75% 10
80% 10
90% 10
95% 13
98% 15
99% 15
100% 16 (longest request)
Controler.php
abstract class Controller implements ViewContextInterface
{
private $params;
public function __construct()
{
$this->params = require dirname(__DIR__, 1) . '/config/params.php';
}
private function renderContent($content): string
{
$layout = $this->findLayoutFile($this->layout);
if ($layout !== null) {
return $this->view->renderFile($layout, ['content' => $content, 'params' => $this->params], $this);
}
return $content;
}
}
What do you think, so it would be available for layouts and views, you could even use hiqdev-composer-plug-in to load all the params of the installed applications ?
Q | A |
---|---|
Version | 3.0 |
PHP version | 7.3.23 |
Operating system | Windows10 |
Error in /yii3.demo/public/
We were unable to find the page /yii3.demo/public/
how can i view that views folder ?
Q | A |
---|---|
Version | 3.0.? |
PHP version | 7,4,0 |
Operating system | win10 - xampp |
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 120 installs, 0 updates, 0 removals
[Foxy\Exception\RuntimeException]
No asset manager is found
I am sure that many users do not need to configure the controller for themselves at all.
And those who need it will be able to inherit the basic controller and supplement it, or create their own.
Also since the class is abstract, please rename it AbstractController
Run ./vendor/bin/yii
in terminal
Commands defined in config/params.php should be in the command list
'console' => [
'commands' => [
'user/create' => Command\User\CreateCommand::class,
'fixture/add' => Command\Fixture\AddCommand::class,
'router/list' => Command\Router\ListCommand::class,
],
],
I believe that the problem is caused by the recent changes in config structure and console
key should be yiisoft/yii-console
.
Q | A |
---|---|
Version | dev |
PHP version | 7.4.6 |
Operating system | Debian 9 (docker) |
I think https://github.com/yiisoft/yii-demo/blob/master/src/Parameters.php should be moved outside from the yiisoft/yii-demo
package.
It can be a separate packet, like as the yiisoft/arrays
or the yiisoft/arrays
or can be added to already existsing packages, but I don't sure.
Also, would be nice to make an interface for that service.
Now validation include only !empty
tests. It would be great to see validator and form components usage
start a new project? any suggestions?
Q | A |
---|---|
Version | 1.0.? |
PHP version | |
Operating system |
Installing demo from composer using command "composer install"
Composer installed the demo with all the dependencies.
Php version dependency error as below:
Problem 1
- Installation request for spatie/phpunit-watcher ^1.23 -> satisfiable by spatie/phpunit-watcher[1.23.0].
- spatie/phpunit-watcher 1.23.0 requires php ^7.2 -> your PHP version (8.0.0) does not satisfy that requirement.
Problem 2
- cycle/proxy-factory v1.2.2 requires php ^7.2 -> your PHP version (8.0.0) does not satisfy that requirement.
- cycle/proxy-factory v1.2.1 requires php ^7.2 -> your PHP version (8.0.0) does not satisfy that requirement.
- cycle/proxy-factory v1.2.0 requires php ^7.2 -> your PHP version (8.0.0) does not satisfy that requirement.
- Installation request for cycle/proxy-factory ^1.2 -> satisfiable by cycle/proxy-factory[v1.2.0, v1.2.1, v1.2.2].
Q | A |
---|---|
Version | 1.0.? |
PHP version | 8.0 |
Operating system | Ubuntu 20.04 |
For shared caches, like APCu, Memcache, the defaut behaviour require to use keyPrefix, because of interpolability of hosting application, which share caches. So, defult configuration is not usabled.
I'm proposing set keyPrefix to \Yii::$app->id by default, so, the default configuration of \yii\cache\ApcCache, \yii\cache\MemCache become usable.
Q | A |
---|---|
Yii version | 2.0.20 |
PHP version | 7.2 |
Operating system | debian linux |
Exclude '@web'=>'@root/public'
, from
'aliases' => [
'@root' => dirname(__DIR__),
'@views' => '@root/views',
'@resources' => '@root/resources',
'@src' => '@root/src',
//'@web'=>'@root/public',
],
situated in file: ..config/params.php
Clean boot
Above error.
Q | A |
---|---|
Version | 3 |
PHP version | 7.49 |
Operating system | Windows 10 |
Could you please provide a brief example of User identity model and login form in this app?
The console application does not work along the path ./vendor/bin/yii
The console application php vendor/yiisoft/yii-console/bin/yii
/usr/bin/env: 'php\r': No such file or directory
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4 |
Operating system | |
Windows yiisoftware/yii-php:7.4-apache Docker conteiner |
Error
Interface 'Psr\Http\Message\ResponseFactoryInterface' not found
At file vendor\httpsoft\http-message\src\ResponseFactory.php
Is there a way to get the DI container from dependency injection without initializing it from the constructor? What I mean is like Laravel which has a resolve
function to get container without initializing it from the constructor.
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4 |
Operating system | Windows 10 |
Using $currentUrl
in layout as indicated in main here.
The current URL.
Although I think $currentRoute
would be more useful.
The value is always NULL
.
Q | A |
---|---|
Version | current dev |
PHP version | 7.4.6 |
Operating system | Debian 9 |
Rather than an issue this one is more feauture request. Yii2 is shipped with Bootstrap 3 as an UI framework. I see, that you add Bootstrap 4 as one of the possible templates. Are there any plans on native Material Design framework support?
в пакете yiisoft/composer-config-plugin-output
в файле web.php
переменная
$baseDir = dirname(__DIR__, 3);
перезаписывается из dotenv.php
на
$baseDir = __DIR__;
итого, установленное приложение ищет папки не из корня приложения, а с корень-приложения/runtime/build/config
Without Builder::rebuild();
on every request Timer
instance cached with initial value so time in the footer shows time elapsed from the config rebuild but not the request time
After installing and configuring demo (with sqlite) without changing anything, running vendor\bin yii fixture/add 20
produces error.
Fixture to add random data.
[ERROR] Maximum function nesting level of '256' reached, aborting!
Q | A |
---|---|
Version | 1.0.? |
PHP version | 7.4.3 |
Operating system | Win 10 x64 |
yii fixture/add 10
is working ok. The error comes from Cycle ORM mapper and it's dependency zendframework/zend-hydrator
. Exception is thrown on this line from yii code.
I will debug it further and open issue on Cycle repository also.
hi, what is the best way to add a Middleware
Thks,
We have two mailer
keys in the params. Need to resolve this
https://github.com/yiisoft/yii-demo/blob/80560c79b35a9018e680354a31c296f0e190dbd9/config/params.php#L21-L28
https://github.com/yiisoft/yii-demo/blob/80560c79b35a9018e680354a31c296f0e190dbd9/config/params.php#L41-L43
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.