<?php
namespace app\components;
use yii\web\UrlRuleInterface;
use yii\base\Object;
class JoomlaUrlRule extends Object implements UrlRuleInterface
{
public function createUrl($manager, $route, $params)
{
return false;
}
public function parseRequest($manager, $request)
{
$it_joomla_url = $request->getPathInfo()===''
&& $request->getQueryParam('option')==='com_content';
if (!it_joomla_url) {
return false;
}
$view = $request->getQueryParam('view');
if (empty($view)) {
return false;
}
return ["$view/view", $request->queryParams];
}
}
[
'components' => [
'urlManager' => [
// ...
'rules' => [
['class' => 'app\components\JoomlaUrlRule'],
// ...
],
],
],
]
RewriteCond %{THE_REQUEST} index.php [NC]
RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=category [NC]
RewriteRule (.*) /category/view/ [L,R=301,QSA]
RewriteCond %{THE_REQUEST} index.php [NC]
RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=article [NC]
RewriteRule (.*) /article/view/ [L,R=301,QSA]
RewriteCond %{THE_REQUEST} index.php [NC]
RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=category [NC]
RewriteCond %{QUERY_STRING} id=(\d+) [NC]
RewriteRule (.*) /category/view?id=%1 [L,R=301]
RewriteCond %{THE_REQUEST} index.php [NC]
RewriteCond %{QUERY_STRING} option=com_content [NC]
RewriteCond %{QUERY_STRING} view=article [NC]
RewriteCond %{QUERY_STRING} id=(\d+) [NC]
RewriteRule (.*) /article/view?id=%1 [L,R=301]
<div>кнопка</div>
body {
background: #C79B4B;
}
div {
width: 200px;
height: 60px;
line-height: 60px;
text-align: center;
color: #FFF;
background:
linear-gradient(-135deg, #C79B4B 0, #C79B4B 5px, #fff 6px, #fff 8px, transparent 9px, transparent 100%),
linear-gradient(135deg, #C79B4B 0, #C79B4B 5px, #fff 6px, #fff 8px, transparent 9px, transparent 100%),
linear-gradient(-45deg, #C79B4B 0, #C79B4B 5px, #fff 6px, #fff 8px, transparent 9px, transparent 100%),
linear-gradient(45deg, #C79B4B 0, #C79B4B 5px, #fff 6px, #fff 8px, transparent 9px, transparent 100%),
linear-gradient(to right,#fff 0, #fff 2px, transparent 3px, transparent calc(100% - 3px), #fff calc(100% - 2px), #fff 100%),
linear-gradient(to bottom, #fff 0, #fff 2px, #f00 3px, #900 calc(100% - 3px), #fff calc(100% - 2px), #fff 100%);
margin: 30px;
}
Перед tr писал а, но он не принимает эти тэги.
<style>
.table {
display: table;
}
.table > a {
display: table-row;
}
.table > a > div {
display: table-cell;
}
</style>
<div class="table">
<a href="#">
<div>1-1</div><div>1-2</div><div>1-3</div>
</a>
<a href="#">
<div>2-1</div><div>2-2</div><div>2-3</div>
</a>
</div>
<table>
<tr onclick="document.location = 'example.com';">
<td>1-1</td><td>1-2</td><td>1-3</td>
</tr>
<tr onclick="document.location = 'example.com';">
<td>2-1</td><td>2-2</td><td>2-3</td>
</tr>
</table>
if ($a == $b) {
}