Programmatically change views pager type or options
Suppose you have a view and want to dynamically alter the number of results shown by the view based on the view arguments.
Programmatically render an exposed filter form
If you need to render an exposed form programmatically, you could use the following snippet. The result will be a renderable array for the exposed form.