-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated code examples to working code for 3.4 #445
Updated code examples to working code for 3.4 #445
Conversation
These changes would make the minimum required Cake version 3.4, which won't be to everyone's taste. Better to keep the older deprecated methods, to broaden compatibility. |
Really 🤔 I mean if not even FoC pushes towards the latest version, then who would? At least when it's just docs :) |
@@ -44,9 +44,9 @@ Basic example | |||
|
|||
.. code:: php | |||
|
|||
<?php echo $this->Form->create('User', ['type' => 'file']); ?> | |||
<?php echo $this->Form->input('User.username'); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok -- I've added the old code in comments after each affected code block. Will this work?
$this->table('users'); | ||
$this->displayField('name'); | ||
$this->primaryKey('id'); | ||
$this->setTable('users'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind adding a note here saying these are for 3.4+, and having the older ones commented out for those who have yet to upgrade cake core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure -- I will give it a go.
I think the |
That could well be. Since I started using cake 2 weeks ago, I will defer to others' experience with that. With that in mind, I've removed the older code. One other thing I wonder about is this: There's no It didn't seem to make a difference in behavior for me, but I wonder if it's more correct. |
Yeah that should be |
Ok - I've fixed the display name. |
I tried using the existing documentation to set up CakePHP-upload for the first time and ran into a few issues. This pull request reflects the changes I had to make to get it to work.
$user
instead ofUser
in lines 47 & 97; I removed the 'User.' from the field names in the input.