Answer the question
In order to leave comments, you need to log in
Am I doing the SSR application structure correctly?
I liked the frontend framework view.
and I would like to ask the following whether it will be right to do this:
build the necessary view components in app.js connect app.js to yii2 and in the form of yii2 already do the following.
<div id="app">
<form @submit.prevent="submitForm">
<div>
<label for="name">Name:</label><br>
<input id="name" type="text" v-model="name" required/>
</div>
<div>
<label for="email">Email:</label><br>
<input id="email" type="email" v-model="email" required/>
</div>
<div>
<label for="caps">HOW DO I TURN OFF CAPS LOCK:</label><br>
<textarea id="caps" v-model="caps" required></textarea>
</div>
<button :class="[name ? activeClass : '']" type="submit">Submit</button>
<div>
<h3>Response from server:</h3>
<pre>{{ response }}
new Vue({
el: '#app',
data() {
return {
name: '',
email: '',
caps: '',
response: '',
activeClass: 'active'
}
},
methods: {
submitForm() {
axios.post('//jsonplaceholder.typicode.com/posts', {
name: this.name,
email: this.email,
caps: this.caps
}).then(response => {
this.response = JSON.stringify(response, null, 2)
})
}
}
})
Answer the question
In order to leave comments, you need to log in
I read the book of V.M. Ilyushechkin, who is my teacher in the disciplines of designing subd and subd oracle. In short, there are two approaches to design.
or you select several entities and their attributes and make a table for each. for example, a table of vendors with their last names, vendor shift number, etc., a table of products with their barcode, price, etc. and then establish links between them. you can draw everything in ERWin, and he himself implements the infological model for any specific DBMS in the form of creation requests and integrity conditions.
the second approach is more universal, it is called the decomposition method. is that when you design, you build a relation (table) containing all possible attributes. it is called the universal relation or first normal form. then you identify all functional dependencies between the attributes and decompose (separate into related tables) the relationship until it breaks down into several relationships that satisfy the normal form of the boy-codd. The advantage of the method is that it does not get hung up on the real meaning of rows and tables and always gives the best result. if you don’t find it on the Internet, I can try to find my own literature, where everything is written
CREATE TABLE `variation` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`person_id` INT(11) unsigned NOT NULL DEFAULT '0',
`place_id` INT(11) unsigned NOT NULL DEFAULT '0',
`item_id` INT(10) unsigned NOT NULL default 0,
`date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`count` INT(11) unsigned NOT NULL default 0,
`summ` decimal(10, 2) UNSIGNED default 0.00,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM;
the first thing that catches your eye, I added default / unsigned here and changed the summ type, after all, rubles and kopecks, besides, I would advise you to use InnoDB, you work with money after all and I think that data safety is important
The normal classical structure, of course, lacks indexes on the fields for which there will be joins, but, as far as I understand, you yourself understand this very well ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question