Log message #4113336

# At Username Text
# Jan 31st 2018, 20:07 edgaras.janusauskas public $components = ['My' => ['className' => MyComponent::class]]
# Jan 31st 2018, 20:06 meder yes
# Jan 31st 2018, 20:06 edgaras.janusauskas when you moved file, did you changes namespace?
# Jan 31st 2018, 20:05 meder problem is specifying it right in the $components property
# Jan 31st 2018, 20:05 meder i have the 'use'
# Jan 31st 2018, 20:04 edgaras.janusauskas also add `use App\Controller\Component\V1\MyComponent`, so `MyComponent::class` would translate to `\App\Controller\Component\V1\MyComponent::class`
# Jan 31st 2018, 20:03 meder public $components = ['My' => MyComponent::class] says MyComponent could not be found, but i can dd(MyComponent::class) in initialize
# Jan 31st 2018, 20:02 edgaras.janusauskas it should work both ways
# Jan 31st 2018, 20:01 meder or do i have to use loadComponent
# Jan 31st 2018, 20:01 meder can I still do that with $components ?
# Jan 31st 2018, 20:00 edgaras.janusauskas use 'className' => MyComponent::class
# Jan 31st 2018, 19:58 meder is there something i'm missing / is there an extra step if you namespace them?
# Jan 31st 2018, 19:58 meder I moved my component from src/Controller/Component/MyComponent.php to src/Controller/Component/V1/MyComponent.php and did "use App\Controller\Component\V1\MyComponent" and public $components = ['My'] but it can't find it?
# Jan 31st 2018, 19:39 zmurphy Ah I see. Thanks, didn't know that it took a className field
# Jan 31st 2018, 19:36 hmic only thing you need to add is the className to tell cake which one to use, because the key in the array is not telling anymore
# Jan 31st 2018, 19:35 hmic insode the form1 and form2 keys you put the respective config, like you did in the 'Form' key before. thats it
# Jan 31st 2018, 19:35 hmic your auth config should look like that: 'Auth' => [ 'Form1' => ['className' => 'Form', ...], ['Form2' => ['className' => 'Form', ...]];
# Jan 31st 2018, 19:33 zmurphy I may be able to do it by swapping out the config based on the controller now that I think of it
# Jan 31st 2018, 19:32 zmurphy I'm not sure I follow. In this case I need two Form authenticates, but obviously that would have duplicate keys in the authenticate array so I'm not sure how to configure that
# Jan 31st 2018, 19:27 hmic probably an example in the book
# Jan 31st 2018, 19:27 edgaras.janusauskas ``` public $components = array( 'Auth' => array( 'className' => 'MyAuth' ) ); ```
# Jan 31st 2018, 19:27 hmic you need to call them different and provide a className key to the config array, to let cake know it's form auth
# Jan 31st 2018, 19:26 hmic sure
# Jan 31st 2018, 19:25 zmurphy Is it possible to configure auth with two different form configurations for two different user models?
# Jan 31st 2018, 18:21 meder is there an easy way to alias a component if you're specifying it with public $Components vs loadComponent?
# Jan 31st 2018, 18:01 meder in 4?
# Jan 31st 2018, 18:01 meder dereuromark: do you think cake will add an option so pagination doesnt throw an exception and redirect much like your paginator component does?
# Jan 31st 2018, 17:15 dereuromark neon: multi select checkbox fields usually
# Jan 31st 2018, 17:01 zmurphy Ah, I found it. It was being created by $this->Form->controls not $this->Form->create
# Jan 31st 2018, 16:57 neon1024 I didn’t think a form created a `<legend>` element
# Jan 31st 2018, 16:34 zmurphy Does anyone know how to set the text of a form's legend in 3.5? Other than screwing with the the template I don't see any documentation on setting the text of the legend. I'm using a null context but the legend is defaulting to 'New Registrant' which is all sorts of wrong for this form.
# Jan 31st 2018, 15:55 dereuromark not in my docs, I am sure :slightly_smiling_face:
# Jan 31st 2018, 15:54 frent I thought I read it somewhere. Anyways I see the mistake. Thanks
# Jan 31st 2018, 15:52 dereuromark $this->MyTable->do($this->AuthUser->...())
# Jan 31st 2018, 15:52 dereuromark instead you should pass it in using the existing component layer
# Jan 31st 2018, 15:52 dereuromark are you sure thats documented? using the trait inside the model layer is not a good idea
# Jan 31st 2018, 15:51 frent if I do that I get followering error:s Table "App\Model\Table\UsersTable" is not associated with "_config"
# Jan 31st 2018, 15:51 frent I loaded the AuthUserTrait in AppTable as described in the documentation. not AclTrait.
# Jan 31st 2018, 15:50 dereuromark sounds like they are not
# Jan 31st 2018, 15:50 dereuromark are both traits on the class?
# Jan 31st 2018, 15:48 frent Anyone got any ideas?