Posted by jhodgdon on June 18, 2009 at 7:27pm
5 followers
| Project: | Views |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
The example on this Handbook page http://drupal.org/node/342132 (Get the result a view creates) looks like a good one for the API section of Views documentation.
Suggest adding it to the Advanced Help inside Views, and then archiving the Handbook page when this has been done.
Comments
#1
Why not even bring this into the views module? I guess its often used
#2
Ok, committed to Views and moved to Documentation queue to handle archiving or editing the old documentation. It may still be valuable as an example of how to manipulate a view even with that function available in Views.
#3
Thanks. The old doc page has been archived.
#4
I've modified the patch to improve DX :
- Changed the function signature to include args = array() .
- Removed some unneeded code fetching arguments.
- Fixed the documentation to comply with Drupal standards.
#5
Note that changing $args to an array makes the signature differ from views_embed_view() -- I'm not sure that's a good thing.
#6
Yes thats exactly what i thought.
views_embed_view('view', 'default', 1, 'type');views_embed_view('view', 'default', array(1, 'type'));
Decide which is more friendly for the developer :) i think the first one.
#7
#8
@dereine,
I think the 2nd option (with the array) is better DX. Just by looking at the function's signature one can know $args can be passed. Currently, they should look into the code and see the func_get_args(), and understand from that they can pass args.
#9
Regardless, consistency with an existing very similar function matters, even if one format may be marginally better. The consistency is more important, and Views is already inconsistent enough, thankyouverymuch =)
#10
Ok, I agree that consistency wins in this case, so "won't fix".