Creates the first version of the Permalink

@param string $title Text that used to create the permalink

@return string
497026
public static function createSlug($title) : string
    {
        $normalizeChars = [
            'Á' => 'A',
            'À' => 'A',
            'Â' => 'A',
            'Ã' => 'A',
            'Å' => 'A',
            'Ä' => 'A',
            'Æ' => 'AE',
            'Ç' => 'C',
            'É' => 'E',
            'È' => 'E',
            'Ê' => 'E',
            'Ë' => 'E',
            'Í' => 'I',
            'Ì' => 'I',
            'Î' => 'I',
            'Ï' => 'I',
            'Ð' => 'Eth',
            'Ñ' => 'N',
            'Ó' => 'O',
            'Ò' => 'O',
            'Ô' => 'O',
            'Õ' => 'O',
            'Ö' => 'O',
            'Ø' => 'O',
            'Ú' => 'U',
            'Ù' => 'U',
            'Û' => 'U',
            'Ü' => 'U',
            'Ý' => 'Y',

            'á' => 'a',
            'à' => 'a',
            'â' => 'a',
            'ã' => 'a',
            'å' => 'a',
            'ä' => 'a',
            'æ' => 'ae',
            'ç' => 'c',
            'é' => 'e',
            'è' => 'e',
            'ê' => 'e',
            'ë' => 'e',
            'í' => 'i',
            'ì' => 'i',
            'î' => 'i',
            'ï' => 'i',
            'ð' => 'eth',
            'ñ' => 'n',
            'ó' => 'o',
            'ò' => 'o',
            'ô' => 'o',
            'õ' => 'o',
            'ö' => 'o',
            'ø' => 'o',
            'ú' => 'u',
            'ù' => 'u',
            'û' => 'u',
            'ü' => 'u',
            'ý' => 'y',

            'ß' => 'sz',
            'þ' => 'thorn',
            'ÿ' => 'y',
        ];

        $title = str_replace(["&lt;", "&gt;", '&amp;', '&#039;', '&quot;', '&lt;', '&gt;'], [
            "",
            "",
            'e',
            '',
            '',
            '',
            '',
        ], htmlspecialchars_decode($title, ENT_NOQUOTES));
        $title = strtr($title, $normalizeChars);
        $title = html_entity_decode(strtolower($title));

        $a = [
            '/ +/'                 => '-',
            '/ \(/'                => '-',
            '/\) /'                => '-',
            '/_+/'                 => '-',
            '/\//'                 => '-',
            "/[^a-zA-Z0-9\\-_+ ]/" => '',
            '/-+/'                 => '-',
            '/^-/'                 => '',
            '/-$/'                 => '',
        ];

        return trim(preg_replace(array_keys($a), array_values($a), $title), '\\-_.+ ');
    }
1289157
public function permalinkFor(string $attribute) : string
    {
        $tmp = new Permalink($this->$attribute);

        return $this->getNumeration($tmp->create());
    }
870738
public function set_title($title) {
        $xpath = new \DOMXpath($this);
        $general = $xpath->query(CC::lom_general_xpath)->item(0);
        $new_title = $this->add_child_ns(CC::LOMIMSCC_NS, $general, 'title');
        $new_string = $this->add_child_ns(CC::LOMIMSCC_NS, $new_title, 'string', $title, array("language" => "en-US"));
    }
132134
public function url($url, $title = null)
    {
        $this->url = $url;
        $this->urlTitle = $title;

        return $this;
    }
1343570
protected function _pageTitle($title, $subtitle = false)
    {
        $out = '<h1 class="titlepad-title">' . $title;
        if ($subtitle !== false) {
            $out .= ' <small>' . $subtitle . '</small>';
        }
        $out .= '</h1>';

        return $out;
    }
527676
private function cleanTitle(string $title): string {
        $openGraph = $this->article()->getOpenGraph();

        // Check if we have the site name in OpenGraph data and it does not match the title
        if (isset($openGraph['site_name']) && $openGraph['site_name'] != $title) {
            $title = str_replace($openGraph['site_name'], '', $title);
        }

        // Try to remove the domain from URL
        if ($this->article()->getDomain()) {
            $title = str_ireplace($this->article()->getDomain(), '', $title);
        }

        // Split the title in words
        // TechCrunch | my wonderfull article
        // my wonderfull article | TechCrunch
        $titleWords = preg_split('@[\s]+@', trim($title));

        // Check for an empty title
        if (empty($titleWords)) {
            return '';
        }

        // Check if last letter is in self::$SPLITTER_CHARS
        // if so remove it
        if (in_array($titleWords[count($titleWords) - 1], self::$SPLITTER_CHARS)) {
            array_pop($titleWords);
        }

        // Check if first letter is in self::$SPLITTER_CHARS
        // if so remove it
        if (isset($titleWords[0]) && in_array($titleWords[0], self::$SPLITTER_CHARS)) {
            array_shift($titleWords);
        }

        // Rebuild the title
        $title = trim(implode(' ', $titleWords));

        return $title;
    }
1345833
public function createViewLink($title, $options = [])
    {
        return $this->Html->link(
            $title,
            ['action' => 'view', $this->getContext()->get($this->getViewVar('primaryKey'))],
            $options
        );
    }
641047
public function setTitle($title = null)
    {
        if ($title === null) {
            $this->title = null;
        }
        else {
            $this->title = (string) $title;
        }
        return $this;
    }
191821
public function getAlternativeTitles($title)
  {
    $builder = $this->db->builder();

    return $builder
      ->select('search.title')
      ->from([$this->table . ' as main'])
      ->join($this->table . ' as search', 'main."aniDbId" = search."aniDbId"')
      ->where('main.title = :title')
      ->queryColumn([ 'title' => $title ]);

  }
412163
public function add($title)
    {
        $item = $this->menu->addItem($title);
        $item->parent_id = $this->id;
        $item->parent = $this;

        return $item;
    }
1195320
public function setTitle(string $title): self
    {
        $this->checkContentType();
        $this->isValidString($title, 20);

        $this->title = $title;

        return $this;
    }
129502
protected function setterTitle(string $title): string
	{
		$this->translator->set($this->name, $title);
		return $title;
	}
264173
protected function setTitle($title)
    {
        $title = trim(preg_replace('/\s\s+/', ' ', str_replace("\n", " ", $title)));

        if ($title != '') {
            $this->title = $title;
        }
    }
1207685
private static function getDisplayTitle( Title $title ) {
	    $pagetitle = $title->getPrefixedText();
	    // remove fragment
	    $title = Title::newFromText( $pagetitle );
	    
        $values = \PageProps::getInstance()->getProperties( $title, 'displaytitle' );
        $id = $title->getArticleID();
        if ( array_key_exists( $id, $values ) ) {
            $value = $values[$id];
            if ( trim( str_replace( '&#160;', '', strip_tags( $value ) ) ) !== '' ) {
                return $value;
            }
        }
        
        // no display title found
        return $title->getPrefixedText();
	}
785619
public function createNode($title = null)
	{
		$node = new Node\ArrayNode();
		$node->setNodeTitle($title);
		$this->add($node);
		
		return $node;
	}
922222
public function title($title = null)
    {
        if ($title === null) {
            return $this->title;
        }

        $title = $this->plain($title);

        if (empty($this->metas['title'])) {
            $this->metas['title'] = $title;
        }

        return $this->title = $title;
    }
700174
public static function text($name, $title=false)
    {
        global $USER;
        if ( ! $USER ) return false;

        $oldsettings = Settings::linkGetAll();
        $configured = isset($oldsettings[$name]) ? $oldsettings[$name] : false;
        if ( $title === false ) $title = $name;
        if ( ! $USER->instructor ) {
            if ( $configured === false || strlen($configured) < 1 ) {
                echo('<p>'._m('Setting').' '.htmlent_utf8($name).' '._m('is not set').'</p>');
            } else {
                echo('<p>'.htmlent_utf8(ucwords($name)).' '._m('is set to').' '.htmlent_utf8($configured).'</p>');
            }
            return;
        }

        // Instructor view
        echo('<label style="width:100%;" for="'.$name.'">'.htmlent_utf8($title)."\n");
        echo('<input type="text" class="form-control" style="width:100%;" name="'.$name.'"');
        echo('value="'.htmlent_utf8($configured).'"></label>'."\n");
    }