Code Monkey home page Code Monkey logo

docs's Introduction

docs's People

Contributors

alexkart avatar antichris avatar arduanovdanil avatar arhell avatar arogachev avatar axtho avatar devanych avatar hacan359 avatar hiqsol avatar iqbalhs avatar machour avatar nex-otaku avatar nicovicz avatar razonyang avatar rugabarbo avatar rustamwin avatar samdark avatar schmunk42 avatar softark avatar tarekajaj avatar thenotsoft avatar toir427 avatar tom-- avatar viktorprogger avatar vincentx1024 avatar vjik avatar wiperawa avatar xepozz avatar xzaero avatar zhuzixian520 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Running yii3 on subfolder with IIS 10

What steps will reproduce the problem?

Assuming that you're using PHP 8.x with IIS 10.0:

  1. Run composer on command prompt (admin)

  2. Run "cd c:\inetput\wwwroot\projects" (this is my main folder)

  3. Run "composer create-project --prefer-dist --stability=dev yiisoft/app basic"

  4. On IIS, expand the Default Web Site -> projects and right click on this folder "Add virtual directory"

  5. On the alias, type "yii3basic" and folder "C:\inetpub\wwwroot\projects\basic\public".

  6. In IIS, click once on "yii3basic" folder, and select PHP Manager. Make sure it's selected PHP 8.x, and the extensions "fileinfo" and "pdo sqlite" are enabled
    imagem_2021-10-05_011658

  7. Open the browser and navigate to http://localhost/projects/yii3basic

  8. If the framework shows any warning about runtime folder, make sure the folders have sufficient permissions

What is the expected result?

Navigate to the landing page (index)

What do you get instead?

A 404 error: The page /projects/yii3basic/ not found.

imagem_2021-10-05_011433

Additional info

Q A
Version dev-master
PHP version 8.0.10
Operating system Windows 10

Wrong ViewRenderer import in "Saying Hello" walkthrough

What steps will reproduce the problem?

What is the expected result?

You should be able to use this to render any view file

What do you get instead?

Yiisoft\Factory\Exception\NotFoundException

No definition or class found for "No definition or class found for "App\ViewRenderer".".

Additional info

Q A
Version 1.0.?
PHP version 8.0.9
Operating system OS X Big Sur

Translate to Kiswahili

I always wanted to translate Yii to Kiswahili Community. but I postponed due to announcement of the advent of Yii3. So This will serve as tracker for my progress on translating Guides and then API to Kiswahili.

Error while installing Composer dependences

I want install Yii 3 to test. Clone repository and start command composer install in root folder. Console return this error:

[Foxy\Exception\RuntimeException]
No asset manager is found

Index page display this:

Warning: require_once(/var/www/public/intnature/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/public/intnature/public/index.php on line 11

Fatal error: require_once(): Failed opening required '/var/www/public/intnature/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/public/intnature/public/index.php on line 11

How I can fix it?
Thank you.

Do Yii3 would provide SPA turn key solutions?

Hi Yii Team,

I really like Yii1/2 which is enable people to build traditional web application easily and robust.
We have plenty of widgets (or Kartik extensions) which were well designed and can use out of box.

SPA is more and more popular in these days. There are different approaches by different framework, such as .Net use Blazor.
Or GoLang use REST+Frontend, or some people create "gin-vue-admin" to try auto generate code to easy the developments. (Some kind like Yii Gii).

The strength of Yii framework is help user to both write frontend & backend code at same framework with high productivity, the feeling is good. Or else, if we have to split as 2 set, then people have lots of other choices, such as use Go/.Net/Java for backend, and Vue(Quasar framework look good)/React/Angular for frontend. As you know PHP speed is slow from backend perspective, the conveniences are the most attracting features.

Do Yii3 plan provide SPA turn key solutions? Such as leverage Vue or React or jQuery/AJAX or whatever to enable users build single page application easily just like before we build traditional web with widgets?

Thanks for your consideration and support in advance.

Regards,
Scott Huang

Add swoole , roadruner entryscript

I have studied yiisoft/docs, but I still can't make yiisoft/app work in swoole, could it add the entry script of swoole and roadrunner to this project ?

About hiqdev/composer-config-plugin and configs

Hi, I'm starting to use yii 3.0 to make some proof of concept and to learn new features from Yii3.0 before it is released.

I have a question about all the config files created in yiisoft/yii-core and other libraries/modules:

The use of https://github.com/hiqdev/composer-config-plugin is really great but I don't understand why some parameters are defined in https://github.com/yiisoft/yii-core/blob/master/config/params.php and used in https://github.com/yiisoft/yii-core/blob/master/config/common.php#L27.

This force the final developper to override keys defined in https://github.com/yiisoft/yii-core/blob/master/config/params.php in its own params.php file which will be cluttered.

I don't think it's a good idea as those values are already hardcoded in yiisoft/yii-core

For example

right now we have :

https://github.com/yiisoft/yii-core/blob/master/config/params.php

return [
    'app.id' => 'core',
    'app.name' => 'Core',
    'app.language' => 'en',
];

and in https://github.com/yiisoft/yii-core/blob/master/config/common.php

...
'app' => [
        'id' => $params['app.id'],
        'name' => $params['app.name'],
        'language' => $params['app.language'],
        'aliases' => array_merge($aliases, [
            '@root'     => YII_ROOT,
            '@vendor'   => '@root/vendor',
            '@public'   => '@root/public',
            '@runtime'  => '@root/runtime',
            '@bower'    => '@vendor/bower-asset',
            '@npm'      => '@vendor/npm-asset',
        ]),
        'params' => $params,
    ],
...

Why do not leave https://github.com/yiisoft/yii-core/blob/master/config/params.php empty

return [
];

and define hardcoded values in https://github.com/yiisoft/yii-core/blob/master/config/common.php

...
'app' => [
        'id' => 'core',
        'name' => 'Core',
        'language' => 'en',
        'aliases' => array_merge($aliases, [
            '@root'     => YII_ROOT,
            '@vendor'   => '@root/vendor',
            '@public'   => '@root/public',
            '@runtime'  => '@root/runtime',
            '@bower'    => '@vendor/bower-asset',
            '@npm'      => '@vendor/npm-asset',
        ]),
        'params' => $params,
    ],
...

This way, app configuration will be done by the developper as it was before :

in app/params.php

return [
    'myparam1' => 'value1',
];

and app/common.php

return [
    'app' => [
        'id' => 'my-app',
        'name' => 'My own Application',
        'language' => 'fr',
    ],
]

and this will leave params.php dedicated to application parameters which will be more clear.

Doctrine support

I can do the configuration guide for doctrine:

  • cli-config
  • doctrine config
  • config container
  • create entity example with metadata unique constraints, onetoone
  • create repository

Thks,

Additional info

Q A
Version 3.0.
PHP version 7.3.23
Operating system Windows 10

Document best practice to use parameters

  1. Services should be configured with parameters.
  2. Services should not access parameters explicitly.
  3. Service should not have access to parameters that aren't meant to be accessed by the service.

Приватные свойства - зачем?

Доброго дня. Т.к. свой новый корпоративный проект я решил сразу начать на yii3, то возник ряд вопросов/непониманий. Относятся они наверно ко всему yii3, но живой кейс возник с виджетом табов, поэтому напишу сюда.

Итак имеем:

  1. Виджет табов, у которого все свойства приватны и имееют type hint
  2. Сеттер на каждое свойство (зачем там устанавливается через clone мне тоже непонятно, но опустим)
  3. В конструкторе виджета генерируется $options['id'] если не установлен

Мой "живой" случай в идеале, но не как сейчас:

$tabs = Tabs::widget();
//Ставим остальные свойства через сеттер

$this->registerJs('Vue.createApp(SourceTabsOptions).mount("#' . $tabs->options['id'] . '");');

Т.е. мне всё-равно какой id сгенерится виджетом, у меня к нему не привязано никаких CSS, ни чего другого. Но сейчас я вынужден каждый раз выдумывать этот самый id элемента, т.к. не могу получить приватный $options

Вопрос - а почему эти свойства не сделать публичными?

  1. Из-за type hint'ов я не смогу поставить недопустимое значение
  2. Это избавит от написания кучи однообразных сеттеров, которые по сути делают тоже самое
  3. При наличие того-же сеттера, приватные свойства не имеют смысла - т.к. я в любой момент могу его изменить через него.

При этом, если допустить ошибку и забыть при конфигурации указать "()" в конце, то yii3 заботливо предлагает добавить "$" в начало, чтобы установить свойство - что опять-же не работает с приватными свойствами. Но как минимум я так полагаю, что задумка такая была, но сейчас я мало где вижу ей применение, т.к. практически всё либо private, либо в лучшем случае protected

Заранее благодарен

Describe application environment modes

Design for configuration rebuild is now (as of 2020-11-12):

  1. Configuration rebuilds every request and every console command in "dev" environment by default.
  2. Configuration DO NOT rebuilds in "prod" environment by default.
  3. New project is created in "dev" environment mode.

This is important differences that should be noted somewhere in docs, "Configuration", "Deployment" or "Installation" section.

Are we free to put models in any folder location?

I realise documentation is not complete and yii3 is still in development. I am just trying to plan a migration from yii2 to yii3 and the only thing I cannot seem to work from this project is where I stick my "models"

Apologies if this is a stupid question. Very much have my Yii2 hat on.

Is there a recommended directory structure?

Yii principles and patterns book

The idea is to describe useful patterns that allow structuring code with Yii 3 examples.

Principles

  • Cohesion / Coupling
  • SOLID
  • Package design principles

Patterns

  • View Model
  • Repository
  • Service

Depedency inside Controllers and other classes

What is the best practice to use a dependency (defined in config) ?

I'd expect to have it from constructor, but other parameters are passed in it.

class CustomController extends \yii\web\Controller
{
         public function __construct(\yii\authclient\clients\GitHub $githubClient)
         {
         }
}

So I've solved using:

Yii::getApp()->container->get(\yii\authclient\clients\GitHub::class)

Is this last the right and suggested approach?

Modules

how a good design of the DI could be done with multiple domains/modules/packages?
(E.g. where you suggest putting interfaces to connect these things later on.)

Access $this->app models.

What steps will reproduce the problem?

$this->app (it is not available in the models).

What is the expected result?

That is available and not using Yii: getApp () which is deprecated en Yii 3.0, remember that in Yii2, Yii::$app was available everywhere.

Of course you can go through the constructor $ this-> app to the model, but it would be cleaner if it were available by default, as in the controllers and views, and thus the use of the new commands is encouraged.

Additional info

Commands in models for example:

$this->app->t
$this->app->user->login
$this->app->params
$this->app->security
Q A
Yii version 3.0
PHP version 7.1.23
Operating system Centos 7.0

Database section

Databses section is really a stub. No mention of Yii2 AR/DAL, nor there is recommended way of handlind data layer with Repos.

Typo in 'Saying Hello'

"src/Controller/Echo.php"
should read
"src/Controller/EchoController.php"

Just a suggestion: Instead of 'Echo' use 'Hello' or 'Greeting', which would enable reader to easily create the 'Form' guide without rewriting the files from that example.

Otherwise, description works well for me

Mike B

A way to disable CSRF protection

Add the following to the URL group or route you need to remove CSRF protection from:

->disableMiddleware(CsrfMiddleware::class)

Using Yii3 as a micro framework

What steps will reproduce the problem?

I setup a boilerplace to build a minimal version of Yii3 for a project. See the composer.json

{
    "minimum-stability": "dev",
    "require": {
        "php": ">=7.2.0",
        "yiisoft/yii-web": "^3.0@dev",
        "yiisoft/di": "^3.0@dev",
        "yiisoft/log": "^3.0@dev",
        "yiisoft/cache": "^3.0@dev"
    }
}

What is the expected result?

I should be able to install dependencies.

What do you get instead?

I receive the following message:

Problem 1
    - Installation request for yiisoft/yii-web ^3.0@dev -> satisfiable by yiisoft/yii-web[3.0.x-dev].
    - yiisoft/yii-web 3.0.x-dev requires psr/http-factory-implementation 1.0 -> no matching package found.

Additional info

Q A
Version 3.0
PHP version 7.3.9
Operating system macOS Catalina

Add convention about keys in params.php

Here need info about keys in params.php.

In yii-cycle and yii-console use vendor/package-name.

In aliases use simple package-name.

It is better to use the same approach in all packages.

I think better always use key vendor/package-name and nested array with params. For example:

return [
	'yiisoft/aliases' => [
		'aliases' => [],
	],
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.