public static function FaqHelper::arg in Frequently Asked Questions 8
Replacement for the old arg() function which is removed in drupal 8.0.0-alpha13 TODO: this should be replaced with the a path service when these are not changing any more.
Parameters
int $id: Number of the path's part.
Return value
string The part of the path which indexed by the given id.
6 calls to FaqHelper::arg()
- OrderForm::buildForm in src/
Form/ OrderForm.php - Form constructor.
- template_preprocess_faq_category_hide_answer in includes/
faq.hide_answer.inc - Create categorized FAQ page if set to show answer when question is clicked.
- template_preprocess_faq_category_new_page in includes/
faq.new_page.inc - Create categorized FAQ page if set to show answer in a new page.
- template_preprocess_faq_category_questions_inline in includes/
faq.questions_inline.inc - Create categorized FAQ page if set to show/hide the questions inline.
- template_preprocess_faq_category_questions_top in includes/
faq.questions_top.inc - Create categorized questions for FAQ page if set to show questions on top.
File
- src/
FaqHelper.php, line 232
Class
- FaqHelper
- Contains static helper functions for FAQ module.
Namespace
Drupal\faqCode
public static function arg($id) {
$url_comp = explode('/', \Drupal::request()
->getRequestUri());
if (isset($url_comp[$id])) {
return $url_comp[$id];
}
else {
return NULL;
}
}