Updated 007 Admin Views (markdown)

Amigo 2019-07-15 15:49:55 +02:00
parent 507505e50f
commit 42eb2682c8

@ -177,12 +177,14 @@ You need to know where the 'save method' is. Open 'sermon' and scroll down to 'g
### Post Save Hook
[01:14:05](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h14m05s)
The 'postSaveHook' is in the controller, not in the model. [01:14:05](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h14m05s) Go to the controller 'sermon'. Scroll to the bottom and find 'postSaveHook'. It gives you the model and the valid data. You can perform extra features on it. [01:14:27](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h14m27s) In all these things you should read the description. The PHP here should run in the 'postSavehook' Method; there is the $model, the data model and the validated data. If you just read our note here, you can start coding for it.
The 'postSaveHook' is in the controller, not in the model. Go to the controller 'sermon'. Scroll to the bottom and find 'postSaveHook'. It gives you the model and the valid data. You can perform extra features on it. [01:14:27](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h14m27s) In all these things you should read the description. The PHP here should run in the 'postSavehook' Method; there is the $model, the data model and the validated data. If you just read our note here, you can start coding for it.
### MySQL Dumps Test Data
[01:15:06](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h15m06s)
You can do two kinds of dumps. What is this used for mostly? Often, while I am busy developing, I'd set up a component, install it, then add dummy data to it to see if it works. [01:15:15](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h15m15s) Every time I make a change and uninstall that component and install the new one, whatever change it made to the database won't be added to the database via an update. You need to uninstall the component and install it again to get the database back to where you want it. The only way I could save time was to re-install this component and the dummy data for sermons I would like to retain. [01:15:43](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h15m43s) Open the tables where it will show a list of all the tables that are in the database at that moment. Scroll to sermon table. Click on it and it will load the table and what it should be called in the data set. [01:16:06](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h16m06s) Let's say you want to have it mapped to multiple tables, then this 'Source Map' is the explanation on how to do that. I won't recommend doing this because you might not get what you expect. [01:16:29](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h16m29s) Going with the values that he populates for you would probably be the best, unless those values change and if you are making changes or adding new fields. You need to reset this by clicking on something else. Click on it again and it loads the new list of fields that are related to the table to the back end view table. [01:16:57](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h16m57s) In that way you compile the component, while the component builder grab the data from the database and build a dump file for you. (See video) [01:17:18](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h17m18s) This might be a little bit complex but it saves time. Another way to do it would be to do a dump file itself. Go to your 'MySQL', open the specific fieldtypes, click on export, select SQL format, and click 'go'. [01:17:40](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h17m40s) This will create a dump file of all the data in the table. You can paste that dump file in here. [01:18:17](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h18m17s) Click 'export', 'quick', SQL, then 'Go'. Save it. Open cb componentbuilder_fieldtpye.sql. [01:18:41](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h18m41s) Replace 'cb' with #_.' Click 'Replace All'. You won't use the table structure because it is already in component builder. You just use this area here. (See video.) [01:19:03](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h19m03s) You would copy this area, cut, go tp MySQL and paste it there. Save. You now have the dump file. It will be added to your new install. [01:19:36](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h19m36s) If a dump file is too big, you will see it after your clicked save; look at the end and see if it had cut it off somewhere. If it had, the dump file is too big for use. (For example, see video.) [01:20:04](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h20m04s)
That was setting up an admin view. [01:21:20](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h21m20s) If you have any questions please email me and I will try to communicate with you. If I see that a certain questions comes up often enough I will include them in a future tutorial. [01:21:35](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h21m35s)