Answers.Body: <p>Take a look at the documentation for civix. To create a page like the mailing templates you could use <code>civix generate:form</code>, as described at <a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-form" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-form</a></p>
  <p>If you prefer to create an angular page, you can also use civix to generate the basic code: <a href="https://docs.civicrm.org/dev/en/latest/framework/angular/quickstart/#create-an-angular-module" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/framework/angular/quickstart/#create-an-angular-module</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-11T18:20:25.917Z
Answers.Text: thank you for your response. can i how should i create a table within the buildquickform method ?
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-11T18:31:29.697Z
Answers.Text: You assign variables in hook_civicrm_buildForm() using `$this->assign('variable_name', $value);` and then you can display them in a table in the .tpl file, e.g. `<div>something</div><div>{$variable_name}</div>`. Take a look at an existing table like the mailing templates to see what it does. It's technically a page not a form, but they're similar. https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php and https://github.com/civicrm/civicrm-core/blob/0dcdc386/templates/CRM/Admin/Page/MessageTemplates.tpl
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T03:02:05.033Z
Answers.Text: Thank you very much for the detail answer
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T14:09:24.387Z
Answers.Text: i want to display the templates name as the row of a table. i planned to extract the data from a sql query and send it into the tpl file and print it by using a loop. however i don't get how should i send the sql result to front end?? 
  in line 127 of 'https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/templates/CRM/Admin/Page/MessageTemplates.tpl ' they used a $template_row variable. I'm just wondering where did they assign these variable...could you please clarify my doubts ? 
  Thanks in advance
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T14:24:18.983Z
Answers.Text: $template_row comes from line 87. It's used in looping through the `$rows` array (see https://www.smarty.net/docsv2/en/language.function.foreach.tpl). And `$rows` comes from the php file: https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php#L273, and that comes from a few lines earlier https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php#L246-L254, which is like SQL but using the [DB framework](https://pear.php.net/manual/en/package.database.db-dataobject.php). There's a lot to learn just to make a table!
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T15:51:15.177Z
Answers.Text: thank you very much, yeah there are so many things to learn.. i have another confusion here - 'https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/CRM/Admin/Page/MessageTemplates.php#L246-L254' it creates object from CRM_Core_BAO_MessageTemplate();..if i want to create a object from a new table which was created by myself is there any specific class to do it ?
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T15:59:07.287Z
Answers.Text: Look at `civix generate:entity`. It will help create the classes you can use. And see https://docs.civicrm.org/dev/en/latest/framework/database/schema-definition/ for the xml definitions.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-13T05:55:22.627Z
Answers.Text: okay . thank you Demerit
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T14:42:02.790Z
Answers.Text: i have another small confusion,from where i can get the action ID and it's corresponding value? ex: https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/templates/CRM/Admin/Page/MessageTemplates.tpl#L11 
  sorry for asking too many questions
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T14:44:19.520Z
Answers.Text: Do you mean how to find out what the numbers mean? They're defined at https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Core/Action.php#L28
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T14:52:11.183Z
Answers.Text: yeah yeah.thank you for the quick response :)
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-10T12:57:43.157Z
Answers.LastActivityDate: 2020-08-10T12:57:43.157Z
Answers.UserDisplayName: Demerit
Body: <p>I want to create a view to show all the created templates and provide the user option to edit and delete the already uploaded file..For example a view like Mailings&gt;&gt;Message Templates.</p>
  <p>I have seen to implement this i want to create a tpl file and tpl.php file for it. I don't get how should i implement this in my extension.mean i don't get how to generate a tpl.php file and create route for it.</p>
  <p>Hope you understand the question. Thanks in advance</p>
  
Tags: <extension>
Title: How to create a view to display all the files in an extension?
ThreadText: # How to create a view to display all the files in an extension?
  
  (Asked by: username_0 on 2020-08-10)
  
  I want to create a view to show all the created templates and provide the user option to edit and delete the already uploaded file..For example a view like Mailings>>Message Templates.
  
  I have seen to implement this i want to create a tpl file and tpl.php file for it. I don't get how should i implement this in my extension.mean i don't get how to generate a tpl.php file and create route for it.
  
  Hope you understand the question. Thanks in advance
  
  **Tags:** extension
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-08-10. Score: 3 | Accepted answer
  
  Take a look at the documentation for civix. To create a page like the mailing templates you could use `civix generate:form`, as described at <https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-form>
  
  If you prefer to create an angular page, you can also use civix to generate the basic code: <https://docs.civicrm.org/dev/en/latest/framework/angular/quickstart/#create-an-angular-module>
  
  > **Comments:**
  > **username_0**: thank you for your response. can i how should i create a table within the buildquickform method ?  
  > **username_1**: You assign variables in hook_civicrm_buildForm() using `$this->assign('variable_name', $value);` and then you can display them in a table in the .tpl file, e.g. `<div>something</div><div>{$variable_name}</div>`. Take a look at an existing table like the mailing templates to see what it does. It's technically a page not a form, but they're similar. https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php and https://github.com/civicrm/civicrm-core/blob/0dcdc386/templates/CRM/Admin/Page/MessageTemplates.tpl  
  > **username_0**: Thank you very much for the detail answer  
  > **username_0**: i want to display the templates name as the row of a table. i planned to extract the data from a sql query and send it into the tpl file and print it by using a loop. however i don't get how should i send the sql result to front end??  in line 127 of 'https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/templates/CRM/Admin/Page/MessageTemplates.tpl ' they used a $template_row variable. I'm just wondering where did they assign these variable...could you please clarify my doubts ?  Thanks in advance  
  > **username_1**: $template_row comes from line 87. It's used in looping through the `$rows` array (see https://www.smarty.net/docsv2/en/language.function.foreach.tpl). And `$rows` comes from the php file: https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php#L273, and that comes from a few lines earlier https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Admin/Page/MessageTemplates.php#L246-L254, which is like SQL but using the [DB framework](https://pear.php.net/manual/en/package.database.db-dataobject.php). There's a lot to learn just to make a table!  
  > **username_0**: thank you very much, yeah there are so many things to learn.. i have another confusion here - 'https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/CRM/Admin/Page/MessageTemplates.php#L246-L254' it creates object from CRM_Core_BAO_MessageTemplate();..if i want to create a object from a new table which was created by myself is there any specific class to do it ?  
  > **username_1**: Look at `civix generate:entity`. It will help create the classes you can use. And see https://docs.civicrm.org/dev/en/latest/framework/database/schema-definition/ for the xml definitions.  
  > **username_0**: okay . thank you username_1  
  > **username_0**: i have another small confusion,from where i can get the action ID and it's corresponding value? ex: https://github.com/civicrm/civicrm-core/blob/0dcdc386b3ba951f856e50e3fab7f7695ffd56ba/templates/CRM/Admin/Page/MessageTemplates.tpl#L11  sorry for asking too many questions  
  > **username_1**: Do you mean how to find out what the numbers mean? They're defined at https://github.com/civicrm/civicrm-core/blob/0dcdc386/CRM/Core/Action.php#L28  
  > **username_0**: yeah yeah.thank you for the quick response :)  
  
  ---
  
  