diff --git a/013-dynamicGet.md b/013-dynamicGet.md index d5aacc8..2bb2603 100644 --- a/013-dynamicGet.md +++ b/013-dynamicGet.md @@ -80,8 +80,10 @@ You can add any table key equal to a certain value. [00:29:48](https://www.youtu To set up a 'getlistquery' with pagination through this ordering method use the 'a.ordering' and send. [00:30:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m39s) You can order all the items. Add many as you like. Be sure the table that you ordering could use a name. It could be a 'name', as in an ordering table key. You can do descending or ascending which would be added to the query. [00:31:03](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m03s) It also added ordering to the data set from your dynamic get method. With the joint view tables you can do dependency calls from other tables in the back end, bringing the data together into one items array. [00:31:25](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m25s) That's what dynamic get is for. There is a main source on the model. -Then we have this other one called 'getpreacher'. [00:31:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m45s)That is another dynamic get function which we have looked at. It's called 'getpreacher'. If it is opened, it is a 'getcustom'. We gave it a custom name called 'getpreacher'. This is its relationships, in this instance it does not have any relationships. It does not link to other tables (See video) [00:32:04](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h32m04s) It simply gets the preachers details right there.(see video) But it has a filter which is basically using the same integer and access levels as the filters. It is using a 'where' and it can be seen that it is published, and that it does not need ordering, because it is one p[00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s) reacher. [00:32:41](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h32m41s) It doesn't have any global settings. That is 'getpreacher'. From this settings, Component Builder writes all this code. You'd see that we have this function everywhere called 'UIkitComp' and are we using a global static method, 'getuikitcomp'. It's a method that V it is DM has build. To get more acquinted with Uikit, go to 'getUIkit' or google it. It's a CSS JavaScript library, which really makes modeling of your views very easy. It has components that you can use, like tool tip andall these kind of models. [00:33:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h33m45s) Guardian is another component. Not all of it's components is loaded every timeit's. We wrote it in PHP, a method that looks at text fields and editor fields. In this component this description field, is a editor field, and so we are sending it to this 'getuikitComp' method. View this method in helper class 'sermondistributor'. It has the classes that already has been identified which is what this initial model field value is holding.[00:34:56](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h34m56s) It is holding any component names that already has been identified. This gets passed also here(classes) with the content. Then we check in the content whether there is a class='uk-' and if it's not 'false', we start looping to check what are all the components that are in there. A list of the components that are available can be seen. On-the-fly it is determined whether these components should be loaded just by looking at the content that was placed in the description field and then it is added back to this array(see video). It updates this, eventually you have an array of all those items. [00:36:00](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h36m00s) In the view, go to the 'view' which in this case is going to be 'Preacher' and open 'view.html.php'. These are of the components that when Component Builder compiled the application, it looks inside of the content of your site view, as well as your custom admin view and it identify that these components must be loaded for Uikit. It is placed here dynamically but since you could have added some components inside of the script that is stored in the description area, it now has this 'getuikitcomponent' which reaches back into the model. and in the model gets this variables' value through a method which is at the bottom of this page.[00:37:04](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h37m04s) There it is 'getuikitComp'. Through this method it is reaching in to get that array. Once it has that array we check if it is set, whether it is an array and if it is an array we set it to the array that is already on this page. Then over here(See video) you loop through that array and load in those components, CSS and JavaScript as required. +'Getpreacher' is another dynamic get function we looked at. [00:31:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m45s) If it is opened, it is a 'getcustom'. Its custom name is 'getpreacher'. These are its relationships; in this instance it does not have any relationships or links to other tables. (See video.) [00:32:04](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h32m04s) It gets the preachers details right here, but has a filter which uses the same integer and access levels as the filters. (See video.) It uses a 'where'; it can be seen that it is published and that it does not need ordering, because it is one preacher. [00:32:41](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h32m41s) It doesn't have any global settings. From these settings, Component Builder writes all this code. We use this function called 'UIkitComp' and a global static method, 'getuikitcomp'. It's a method that VDM built. To get more acquainted with Uikit, google 'getUIkit'. It's a CSS JavaScript library, which makes the modeling of your views easy. It has components that you can use, like tool tip andall, etc. [00:33:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h33m45s) Guardian is another component. But not all of its components are loaded every time. -You can be sure that the Uikit's needed components will be loaded on the page, simply by 'user' adding some of that components to its description as style and while Uikit works like Bootstrap, the class name can be added to the specific DIF or HTML tag and then activates the needed scripting around it. [00:38:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m08s) That is a nice library but it is quite huge. +We wrote a method in PHP that looks at text fields and editor fields. This is an editor field, so we send it to 'getuikitComp' method. View this method in helper class 'sermondistributor'. It has the classes already identified which is what this initial model field value holds. [00:34:56](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h34m56s) It holds any component names that has already been identified. This also get passed here with the content. Check in the content whether there is a class='uk'; if it's not 'false', start looping to check which components there are. A list of the components that are available can be seen. It is determined on-the-fly whether these components should load by looking at the content placed in the description field. It is then added back to this array. (See video.) This is updated and eventually you have an array of the items. [00:36:00](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h36m00s) In the view, go to the 'view', in this case, 'Preacher', and open 'view.html.php'. When Component Builder compiled the application these are the components that look inside the content of your site view, as well as your custom admin view, and identify that these components must be loaded for Uikit. It is placed here dynamically but since you could have added some components inside the script that is stored in the description area, it has 'getuikitcomponent' which reaches back into the model and gets the variables' value through a method at the bottom of this page,'getuikitComp'. (See video.) [00:37:04](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h37m04s) Through this method it reaches in to get the array. Once it has the array, check if it is set and an array. If it is an array, set it to the array already on the page. Here loop through the array and load these components, CSS and JavaScript, as required. (See video.) -There is a way to do this through JavaScript, but I do most of it in the HTML, to leave the load on the server. That's why this feature has been added, although this is maybe beyond the scope of the dynamic get. It is all also placed in the query that is developed by dynamic get, that's partly why it fits. Once you've got your dynamic get set up, these dynamic gets may be added to either site views or to custom admin views. These 'dynamic gets' is what gets the data for you. It's where you model the data that you want to work with. You can then [00:39:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m12s) use them in site views and custom admin views. +The Uikit's needed components will be loaded on the page by 'user' adding some of the components to its description as style. While Uikit works like Bootstrap, the class name can be added to the specific DIF or HTML tag and activate the needed scripting around it. [00:38:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m08s) + +You can do this through JavaScript, but I do most of it in the HTML to leave the load on the server. That's why this feature has been added, although it is perhaps beyond the scope of the dynamic get. It fits partly because it is placed in the query developed by dynamic get. Once you've dynamic get set up, these dynamic gets may be added to either site views or custom admin views. These 'dynamic gets' are what gets the data for you. It's where you model the data that you want to work with. [00:39:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m12s) You can then use them in site views and custom admin views. \ No newline at end of file