Updated 013 dynamicGet (markdown)
parent
5c559f870f
commit
3d60d2ed18
@ -53,32 +53,34 @@ When we look at the site layout area and the templates I'll talk about this tran
|
||||
|
||||
### Dynamic Get Custom Script
|
||||
|
||||
Returning to the dynamic get, it can be seen that there is a custom script area. If you click on it, you will see different switches. [00:21:54](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m54s) You can select 'getlistquery' or 'before getting the items' and 'after getting the items'. If you select 'after getting the items' and you place any code there, then data gets dumped right after the initial items you have received. [00:22:14](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m14s) It will add that code in there, and then return the items. That is why you can model the data right there in the dynamic get. You are going to write the code for the data after it has been 'get'. It can be checked if this code has been removed here, it will indicates if there is an array of items where all values are. [00:23:02](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m02s) Make sure that those items are set and that it is there. A 'string bracket component helper function' is used to check whether the string is there. Here can some nice PHP be dumped. Even before getting the item you can add some filters or get list query,if this is model list. If this is item, you'd see that there's a different set of switches is available. It adjusts to the type of query up here. [00:23:19](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m19s)
|
||||
Returning to the dynamic get. A custom script area can be seen. If you click on it, there are different switches. [00:21:54](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m54s) You can select 'getlistquery', 'before getting the items', or 'after getting the items'. If you select 'after getting the items' and place code there, data gets dumped right after the initial items you received. [00:22:14](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m14s) It will add the code in there and return the items. That is why you can model the data in the dynamic get; write the code for the data after it had been 'get'. If this code had been removed, it will indicate if there is an array of items where all values are. [00:23:02](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m02s) Make sure those items are set and there. (A 'string bracket component helper function' is used to check whether the string is there.) Some nice PHP can be dumped here. Even before getting the item you can add some filters or get list query if this is model list. If it is item, there's a different set of switches is available. It adjusts to the type of query up here. [00:23:19](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m19s)
|
||||
|
||||
### Dynamic Get Join DB Tables
|
||||
|
||||
Coming back to this 'Join View Tables' area. Let's again look at the database table option. If category is selected and it's a single row that is returned. It is called 'b'. It is joined to the left, and set 'a.catid' that it should be equal to 'b.id', which is the 'id' of the category. Only a title and the alias is needed. That is how it is set up. [00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s) Only the title and the alias is nessesary and it is been returned. Then it links it in there(see video), and that's part of what is seen here when viewing the query option, it is the sixth section.
|
||||
Coming back to the 'Join View Tables' area. Let's look at the database table option. If category is selected and it's a single row that is returned, it is called 'b'. It is joined to the left, and set 'a.catid' to be equal to 'b.id' which is the ID of the category. Only a title and alias is needed. That is how this is set up. [00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s) Only the title and the alias are necessary and has been returned. It links it in there which is part of what is seen here when viewing the query option, the sixth section. (See video.)
|
||||
|
||||
### Dynamic Get Filters - Where - Ordering - Globals
|
||||
|
||||
Taking a look at the filters. Here is a 'filter',a'where', an 'ordering' and a 'setting' of globals. [00:24:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m12s) The 'setting' of globals is if you have a value in this query that you possibly want to use in a custom query, which isn't even setup yet, but you want to know if this value is needed in the model. Then through this global option here, a global area can be set. Maybe it should be tested here(See video) . There is an option of using 'This' and 'State'. [00:24:38](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m38s) It is the different set types. You can set the value to 'State' or you can set the value to 'This'.
|
||||
Here is a 'filter', a'where', an 'ordering' and a 'setting' of globals. [00:24:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m12s) The 'setting' of globals: if you have a value in this query that you want to use in a custom query (which isn't setup yet, but you want to know if this value is needed in the model) then, through this global option here, a global area can be set. It could be tested here. (See video.) There is an option to use 'This' and 'State'. [00:24:38](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m38s) It is the different set types. You can set the value to 'State' or the value to 'This'.
|
||||
|
||||
It is nessesary to know the key. If for example 'name' is used: In this case it is not going to work because there is more than one name. Usually this global function only functions well when you are returning a single item.[00:25:01](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m01s) When 'getitem' not 'getlistquery' is done, it makes sense and then you can give it a name. It will add it to the global scope of the model which you can access through other model methods which are custom methods. That is setting the global. [00:25:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) There is a list of possible filtering. Depending on what needs to be done, 'ID','user', 'access, 'level', 'group', 'category', 'tags' or 'date' may be selected.[00:25:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m45s) Some of these are not formulated yet. Like 'date' doesn't work that well yet. 'Categories' does, 'user', 'group', 'access level', 'user' and 'id' does well. The function 'variable' works well. As well as 'array', 'value', 'repeatable value'', and other work very well. You can use them and implement them. [00:26:15](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m15s) The only way to know exactly how it works is to know a little PHP, and then you need to compile it and go look in the code what it has done and where it's placed what. That is why all this is set in the model. Currently we are saying we wanted to do a 'JRequest::getint by id'. [00:26:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m39s)This is the get area that has been added. If you look in the code you will see 'State Key' and this, 'JRequest::getint by id'. It is a function variable, it does not change or adapt this at all. Then it indicates that it must be equal to 'preacher'. Since Component Builder doesn't know if this variable is going to be a string or integer, therefore this function first needs to check if it is a string, and then checks whether it's a number and builds up the query respectively. It is the only way to implement it at this stage. [00:27:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m08s)
|
||||
It is necessary to know the key. For example in this case, if 'name' is used it won't work because there are more than one name. Usually this global function only function well when you return a single item. [00:25:01](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m01s) When 'getitem', not 'getlistquery', is done you can give it a name because it makes sense. It won't add it to the global scope of the model that you can access through other model methods which are custom methods. [00:25:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s)
|
||||
|
||||
There is a list of possible filtering. Depending on what needs to be done any of these may be selected. (See video.) [00:25:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m45s) Some of them aren't formulated yet. 'Date', for example, doesn't work well yet. These do: 'Categories', 'user', 'group', 'access level', 'user' 'id', the function 'variable', array', 'value', 'repeatable value'. (See video.) You can use and implement them. [00:26:15](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m15s) To know how it works some knowledge of PHP is needed. You need to compile it and look in the code what it has done and where it placed what. That is why this is all set in the model. For example, we wanted to do a 'JRequest::getint by id'. [00:26:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m39s) This is the get area that has been added. In the code you will see 'State Key' and 'JRequest::getint by id'. It is a function variable; it does not change or adapt this at all. It indicates that it must be equal to 'preacher'. Since Component Builder doesn't know if this variable is going to be a string or integer, this function has to check if it is a string or a number and then build up the query respectively. It is the only way to implement it at this stage. [00:27:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m08s)
|
||||
|
||||
|
||||
### Dynamic Get Get Access( Default added)
|
||||
|
||||
Then there is the 'Access'. We have a bunch of values that fire every time in a custom dynamic get model.[00:27:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m39s) It is the these(see video) values that you often might need. Instead of you having to do custom scripting to get these values on the page, these values dynamically gets added every time. The 'userid', the 'group', the 'authorised group', the 'access level', the 'app', and then the 'input values', which is by either URL or post is on the page, and indicates that it has been initiated, and set it to true. [00:28:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m08s) That is if you have custom methods, like this one 'getpreacher', it checks whether it has been set. If it has been set it does not set that again, it is ready to be used. But if it has not been set, it sets it, and also again sets it to true. [00:28:32](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m32s) These global variables can be used inside of the code like the global variable we spoke of earlier. Out of that global variable we are accessing this 'levels', which has the get authorized view levels of the specific user that has now accessed this model or the view that this model belongs to. [00:29:00](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m00s) If he is in these access levels. You remember that 'public' is another access level. If the user isn't signed in, he is 'public'. This will validate true in the query. We set that up simply by adding access level in 'a.access'. [00:29:28](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m28s) You must check in the main source table for 'a.access' whether the user is in that. That means you don't need to add a 'state key' because the code is done for you. That is some of the filters.
|
||||
### Dynamic Get Access (Default added)
|
||||
|
||||
We have a bunch of values that fire every time in a custom dynamic get model. [00:27:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m39s) You might need these values. (See video.) Instead of doing custom scripting to get these values on the page, these values gets dynamically added every time. The 'userid', the 'group', the 'authorised group', the 'access level', the 'app', and the 'input values' are on the page by either URL or post; it indicates that it has been initiated, and set it to true. [00:28:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m08s) If you have custom methods, like 'getpreacher', it checks whether it had been set. If it had, it does not set it again; it is ready to be used. But if it hasn't been set, it sets it, and again sets it to true. [00:28:32](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m32s) These global variables can be used inside the code like the global variable we spoke of earlier. Out of that global variable we access the 'levels', which has the get authorized view levels of the specific user that has now accessed this model or the view this model belongs to. If it is in the access levels. [00:29:00](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m00s) 'Public' is another access level. If the user isn't signed in, he is 'public'. This will validate true in the query. Set it up by adding access level in 'a.access'. [00:29:28](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m28s) Check in the main source table for 'a.access' if the user is there. So you don't need to add a 'state key' because the code is done for you. [00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s)
|
||||
|
||||
### Dynamic Get "Where"
|
||||
|
||||
[00:29:48](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m48s) You can add any table key equals to a certain value. That value could be another table like "b.field" or it could even be a global variable like we said we could set up. It can also be an 'id', a 'userid'. The 'userid' is already on the table. It could be like we have done in this case, only an integer which is '1'. It is important to make sure that all the sermons returned is published. [00:30:18](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m18s) If you have an unpublished sermon it will not be returned at all.
|
||||
You can add any table key equal to a certain value. [00:29:48](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m48s) The value could be another table like "b.field" or it even a global variable, like we said we can set up. It can also be an 'userid' which is already on the table. It could be done as in this case, only an integer, '1'. It is important to make sure that all the sermons returned are published. [00:30:18](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m18s) If you have an unpublished sermon it won't be returned at all.
|
||||
|
||||
### Dynamic Get Ordering
|
||||
|
||||
That is setting up a 'getlistquery' with pagination through this ordering method we just says, 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. Just add many as you like. Be sure that the table that you ordering, could even use a name. It could be a 'name' as an ordering table key. Then you could do a descending or ascending. It would be added to the query. [00:31:03](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m03s) That is also added ordering to the data set from your dynamic get method. Here with the joint view tables you can do very nice dependency calls from other tables in the back end, and bring 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. As it can be seen there is a main source on the model.
|
||||
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 preacher. [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 VDM 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 time. 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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user