Comments (12)
within the current state of the software, this is expected behavior.
In order to get the right label, you should use:
$form->field($formModel->summaryReview, 'rate')
->textInput([
'type' => 'number'
]) ?>
from yii-core.
@dynasource woulnt the field name be incorrect then?
from yii-core.
correct. To my knowledge, this is could be further improved.
from yii-core.
$form->field($formModel->summaryReview, 'rate')
is another model, which I have to load and validate individually. I want this model to be nested for convenience.
from yii-core.
@TerraSkye AFAIK you could override getAttributeLabel
and implement the label resolution there. Ideally you forward it so it takes the label from the related model.
from yii-core.
@SamMousa overridding of getAttributeLabel
is not working. My form has inputs with names CompletedOrderReviewForm[**primaryReview**][rate]
, CompletedOrderReviewForm[**summaryReview**][rate]
and CompletedOrderReviewForm[**secondaryReviews**][rate]
, but CompletedOrderReviewForm::getAttribute
receives only primaryReview
, summaryReview
and secondaryReviews
as arguments. There is not way to know what field's label of my nested model requested.
from yii-core.
Ah ok;don't know how to get around that.
from yii-core.
the only workaround i see is to manually set the label.
from yii-core.
I agree this to be an issue. Hasnt this been posted before in another ticket?
from yii-core.
@TerraSkye do you mean $form->field(...)->label(...)? Field name would be ok, but messages in validation errors are not.
from yii-core.
personally i had bad experience by nesting models, the way u presented and therefore i tend to avoid that situation, but yes i understand the issue.
from yii-core.
There are no models anymore.
from yii-core.
Related Issues (20)
- 我认为yii3最应该解决的就是composer包过大的问题 HOT 2
- Should not require yii-web HOT 11
- Enhancement: BaseJson::decode supports decode options HOT 1
- Discuss: Do we still need controllers? HOT 2
- Enhancement: StringHelper::isEmpty() HOT 7
- can't visit yii forum site HOT 1
- Review helpers naming and usage HOT 33
- Url::ensureScheme should fail hard for non absolute paths HOT 2
- What is the current dependency between repo? HOT 20
- Yii3 assets path not correctly reference if installed in subfolder HOT 2
- SOLID compliance HOT 3
- cannot use @web or @webroot in config. HOT 53
- Deal with relative links in Formatter::asUrl() HOT 4
- Custom reference syntax to class or class member in comments make impossible to navigate in IDE HOT 19
- Change namespace to Yiisoft\Core? HOT 8
- When will yii3 be released? HOT 1
- Request to separate FileHelper from yii-core HOT 19
- Pack requirements checker into separate package HOT 1
- Repo merges into a repo and then splits HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii-core.