Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
https://joomla.stackexchange.com/q/26382/12352
Créé
il y a 7 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
10 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
41 lignes
Copier tout
6 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
39 lignes
Copier tout
class BookstoreRouter extends JComponentRouterView
class BookstoreRouter extends JComponentRouterView
{
{
public function __construct($app = null, $menu = null)
public function __construct($app = null, $menu = null)
{
{
$books = new JComponentRouterViewconfiguration('books');
$books = new JComponentRouterViewconfiguration('books');
Copier
Copié
Copier
Copié
$books->setNestable();
$this->registerView($books);
$this->registerView($books);
$book = new JComponentRouterViewconfiguration('book');
$book = new JComponentRouterViewconfiguration('book');
$book->setKey('id')->setParent($books);
$book->setKey('id')->setParent($books);
$this->registerView($book);
$this->registerView($book);
parent::__construct($app, $menu);
parent::__construct($app, $menu);
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
}
}
public function getBookSegment($id, $query)
public function getBookSegment($id, $query)
{
{
Copier
Copié
Copier
Copié
if (
!
strpos($
id
, ':')
)
if (
strpos($
query['id']
, ':')
=== false)
{
{
$db = JFactory::getDbo();
$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery = $db->getQuery(true);
Copier
Copié
Copier
Copié
$dbquery->select($
dbquery->qn
('alias'))
$dbquery->select($
db->quoteName
('alias'))
->from($
dbquery->qn
('#__bookstore_books'))
->from($
db->quoteName
('#__bookstore_books'))
->where('id = ' . $
dbquery->q
($id));
->where('id = ' . $
db->quote
($id));
$db->setQuery($dbquery);
$db->setQuery($dbquery);
$id .= ':' . $db->loadResult();
$id .= ':' . $db->loadResult();
}
}
Copier
Copié
Copier
Copié
return array((int)
$id => $id);
return array((int)
$id => $id);
}
}
public function getBookId($segment, $query)
public function getBookId($segment, $query)
{
{
Copier
Copié
Copier
Copié
return (int)
$segment;
return (int)
$segment;
}
}
}
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
class BookstoreRouter extends JComponentRouterView { public function __construct($app = null, $menu = null) { $books = new JComponentRouterViewconfiguration('books'); $books->setNestable(); $this->registerView($books); $book = new JComponentRouterViewconfiguration('book'); $book->setKey('id')->setParent($books); $this->registerView($book); parent::__construct($app, $menu); $this->attachRule(new JComponentRouterRulesMenu($this)); $this->attachRule(new JComponentRouterRulesStandard($this)); $this->attachRule(new JComponentRouterRulesNomenu($this)); } public function getBookSegment($id, $query) { if (!strpos($id, ':')) { $db = JFactory::getDbo(); $dbquery = $db->getQuery(true); $dbquery->select($dbquery->qn('alias')) ->from($dbquery->qn('#__bookstore_books')) ->where('id = ' . $dbquery->q($id)); $db->setQuery($dbquery); $id .= ':' . $db->loadResult(); } return array((int) $id => $id); } public function getBookId($segment, $query) { return (int) $segment; } }
Texte modifié
Ouvrir un fichier
class BookstoreRouter extends JComponentRouterView { public function __construct($app = null, $menu = null) { $books = new JComponentRouterViewconfiguration('books'); $this->registerView($books); $book = new JComponentRouterViewconfiguration('book'); $book->setKey('id')->setParent($books); $this->registerView($book); parent::__construct($app, $menu); $this->attachRule(new JComponentRouterRulesMenu($this)); $this->attachRule(new JComponentRouterRulesStandard($this)); $this->attachRule(new JComponentRouterRulesNomenu($this)); } public function getBookSegment($id, $query) { if (strpos($query['id'], ':') === false) { $db = JFactory::getDbo(); $dbquery = $db->getQuery(true); $dbquery->select($db->quoteName('alias')) ->from($db->quoteName('#__bookstore_books')) ->where('id = ' . $db->quote($id)); $db->setQuery($dbquery); $id .= ':' . $db->loadResult(); } return array((int)$id => $id); } public function getBookId($segment, $query) { return (int)$segment; } }
Trouver la différence