private function findSection($section)
	{
		// Check section type
		if (is_int($section) || $section === 'new') {
			return $section;
		} else if (is_string($section)) {
			// Search section names for related index
			$sections = array_keys($this->sections->byName);
			$index = array_search($section, $sections);

			// Return index if found
			if ($index !== false) {
				return $index;
			}
		}

		// Return error message and value
		$this->error = array();
		$this->error['page'] = "Section '$section' was not found on this page";
		return -1;
	}
private function findSection($section)
	{
		// Check section type
		if (is_int($section) || $section === 'new') {
			return $section;
		} else if (is_string($section)) {
			// Search section names for related index
			$sections = array_keys($this->sections->byName);
			$index = array_search($section, $sections);

			// Return index if found
			if ($index !== false) {
				return $index;
			}
		}

		// Return error message and value
		$this->error = array();
		$this->error['page'] = "Section '$section' was not found on this page";
		return -1;
	}
private function findSection ( $ section ) { // Check section type if ( is_int ( $ section ) || $ section === 'new' ) { return $ section ; } else if ( is_string ( $ section ) ) { // Search section names for related index $ sections = array_keys ( $ this -> sections -> byName ) ; $ index = array_search ( $ section , $ sections ) ; // Return index if found if ( $ index !== false ) { return $ index ; } } // Return error message and value $ this -> error = array ( ) ; $ this -> error [ 'page' ] = "Section '$section' was not found on this page" ; return - 1 ; }
Find a section's index by name.
If a section index or 'new' is passed, it is returned directly.

@param   mixed  $section  The section name or index to find
@return  mixed            The section index, or -1 if not found
Find a section s index by name . If a section index or new is passed it is returned directly .