GFPDFViewView_Welcome_Screen

View_Welcome_Screen.

Defined (1)

The class is defined in the following location(s).

/src/view/View_Welcome_Screen.php  
  1. class View_Welcome_Screen extends Helper_Abstract_View { 
  2.  
  3. /** 
  4. * Set the view's name 
  5. * @var string 
  6. * @since 4.0 
  7. */ 
  8. protected $view_type = 'Welcome'; 
  9.  
  10. /** 
  11. * Holds the abstracted Gravity Forms API specific to Gravity PDF 
  12. * @var \GFPDF\Helper\Helper_Form 
  13. * @since 4.0 
  14. */ 
  15. protected $gform; 
  16.  
  17. /** 
  18. * Setup our class by injecting all our dependancies 
  19. * @param array $data_cache An array of data to pass to the view 
  20. * @param \GFPDF\Helper\Helper_Form|Helper_Abstract_Form $gform Our abstracted Gravity Forms helper functions 
  21. * @since 4.0 
  22. */ 
  23. public function __construct( $data_cache = [], Helper_Abstract_Form $gform ) { 
  24.  
  25. /** Call our parent constructor */ 
  26. parent::__construct( $data_cache ); 
  27.  
  28. /** Assign our internal variables */ 
  29. $this->gform = $gform; 
  30.  
  31. /** 
  32. * Load the Welcome Tab tabs 
  33. * @since 4.0 
  34. */ 
  35. public function tabs() { 
  36.  
  37. /** Load any variables we want to pass to our view */ 
  38. $args = [ 
  39. 'selected' => isset( $_GET['page'] ) ? $_GET['page'] : 'gfpdf-getting-started',  
  40. ]; 
  41.  
  42. /** load the tabs view */ 
  43. $this->load( 'tabs', $args ); 
  44.  
  45. /** 
  46. * Output the welcome screen 
  47. * @since 4.0 
  48. */ 
  49. public function welcome() { 
  50.  
  51. /** Load any variables we want to pass to our view */ 
  52. $args = [ 
  53. 'forms' => $this->gform->get_forms(),  
  54. ]; 
  55.  
  56. /** Render our view */ 
  57. $this->load( 'welcome', $args ); 
  58.