GithubHelp home page GithubHelp logo

CurrentRequest is valid about demo HOT 13 CLOSED

hiscaler avatar hiscaler commented on July 20, 2024
CurrentRequest is valid

from demo.

Comments (13)

hiscaler avatar hiscaler commented on July 20, 2024 1

i used 2.0, i upgrade reference blog example. It was okay before

from demo.

hiscaler avatar hiscaler commented on July 20, 2024 1

Sorry , i don't add auth middleware to rule. so can't get it. Very very sorry!

from demo.

vjik avatar vjik commented on July 20, 2024

What is "CurrentRequest" from issue theme?

Is problem with "UserRequest"? Please, show code of this class.

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

UserRequest class

<?php

declare(strict_types=1);

namespace App\User;

use Yiisoft\Auth\Middleware\Authentication;
use Yiisoft\Input\Http\Attribute\Parameter\Request;
use Yiisoft\Input\Http\RequestInputInterface;

final class UserRequest implements RequestInputInterface
{

    #[Request(Authentication::class)]
    private User $user;

    public function getUser(): User
    {
        return $this->user;
    }

}

from demo.

vjik avatar vjik commented on July 20, 2024

Seems, you need to use request catcher. There are to make it two ways.

  1. Use RequestCatcherParametersResolver in middleware dispatcher. Example here: https://github.com/yiisoft/demo/blob/master/blog-api/config/web/di/middleware-dispatcher.php#L12

  2. Add RequestCatcherMiddleware to list of your middlewares

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

I already use first way, but invalid

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

Is setting error?

from demo.

vjik avatar vjik commented on July 20, 2024

Hm. Does it work before release Yii User 2.1?

from demo.

vjik avatar vjik commented on July 20, 2024

I tested demo, everything is working correctly.

May be you don't configure hydrator: https://github.com/yiisoft/demo/blob/master/blog-api/config/common/di/hydrator.php ?

PR with demo adaptation: #599. May be it help you...

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

Have been configured

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

I rollback it, Wait till I have time to test

A lot of things have not been officially released, and there are still a lot of questions. Of course, it has something to do with my unfamiliarity.

from demo.

hiscaler avatar hiscaler commented on July 20, 2024

When are you ready to release Yii3?

from demo.

vjik avatar vjik commented on July 20, 2024

When are you ready to release Yii3?

I hope that soon. Currently we hard work with code (hydrator and forms almost ready), then planned create/improve docs.

I rollback it, Wait till I have time to test

I moved tihs issue to demo repo.

from demo.

Related Issues (20)

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.