Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/plugins/views_plugin_display_default.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Contains the default display plugin.
|
|
5 |
* Definition of views_plugin_display_default.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
... | ... | |
11 | 11 |
* @ingroup views_display_plugins |
12 | 12 |
*/ |
13 | 13 |
class views_plugin_display_default extends views_plugin_display { |
14 |
|
|
14 | 15 |
/** |
15 | 16 |
* Determine if this display is the 'default' display which contains |
16 |
* fallback settings |
|
17 |
* fallback settings.
|
|
17 | 18 |
*/ |
18 |
function is_default_display() { return TRUE; } |
|
19 |
public function is_default_display() { |
|
20 |
return TRUE; |
|
21 |
} |
|
19 | 22 |
|
20 | 23 |
/** |
21 | 24 |
* The default execute handler fully renders the view. |
... | ... | |
26 | 29 |
* @endcode |
27 | 30 |
* |
28 | 31 |
* For more complex usages, a view can be partially built: |
32 |
* |
|
29 | 33 |
* @code |
30 | 34 |
* $view->set_arguments($args); |
31 |
* $view->build('default'); // Build the query |
|
35 |
* $view->build('default'); // Build the query.
|
|
32 | 36 |
* $view->pre_execute(); // Pre-execute the query. |
33 |
* $view->execute(); // Run the query |
|
34 |
* $output = $view->render(); // Render the view |
|
37 |
* $view->execute(); // Run the query.
|
|
38 |
* $output = $view->render(); // Render the view.
|
|
35 | 39 |
* @endcode |
36 | 40 |
* |
37 |
* If short circuited at any point, look in $view->build_info for |
|
38 |
* information about the query. After execute, look in $view->result
|
|
39 |
* for the array of objects returned from db_query.
|
|
41 |
* If short circuited at any point, look in $view->build_info for information
|
|
42 |
* about the query. After execute, look in $view->result for the array of
|
|
43 |
* objects returned from db_query. |
|
40 | 44 |
* |
41 | 45 |
* You can also do: |
46 |
* |
|
42 | 47 |
* @code |
43 | 48 |
* $view->set_arguments($args); |
44 |
* $output = $view->render('default'); // Render the view |
|
49 |
* $output = $view->render('default'); // Render the view.
|
|
45 | 50 |
* @endcode |
46 | 51 |
* |
47 |
* This illustrates that render is smart enough to call build and execute |
|
48 |
* if these items have not already been accomplished.
|
|
52 |
* This illustrates that render is smart enough to call build and execute if
|
|
53 |
* these items have not already been accomplished. |
|
49 | 54 |
* |
50 |
* Note that execute also must accomplish other tasks, such |
|
51 |
* as setting page titles, breadcrumbs, and generating exposed filter |
|
52 |
* data if necessary. |
|
55 |
* Note that execute also must accomplish other tasks, such as setting page |
|
56 |
* titles, breadcrumbs, and generating exposed filter data if necessary. |
|
53 | 57 |
*/ |
54 |
function execute() { |
|
58 |
public function execute() {
|
|
55 | 59 |
return $this->view->render($this->display->id); |
56 | 60 |
} |
61 |
|
|
57 | 62 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules