Commit ba7eea0e9df2930faf893fe693c109d13a20902f
1 parent
62b5fbaa
- bug fix
Showing
2 changed files
with
45 additions
and
51 deletions
Show diff stats
frontend/microdata/MicrodataFabric.php
1 | <?php | 1 | <?php |
2 | -namespace frontend\microdata; | ||
3 | - | ||
4 | -use frontend\microdata\Microdata; | ||
5 | - | ||
6 | - | ||
7 | - | ||
8 | - | ||
9 | -class MicrodataFabric extends Microdata | ||
10 | -{ | ||
11 | - public static function createJsonFromProduct($product) | 2 | + |
3 | + namespace frontend\microdata; | ||
4 | + | ||
5 | + use frontend\microdata\Microdata; | ||
6 | + | ||
7 | + class MicrodataFabric extends Microdata | ||
12 | { | 8 | { |
13 | - return ($product==null)? | ||
14 | - new ProductMicrodata(array_merge(['url'=>123],self::getDefaultSettings())) | ||
15 | - : | ||
16 | - new ProductMicrodata(array_merge($product,['url'=>123],self::getDefaultSettings())); | ||
17 | - } | ||
18 | - public static function createJsonFromArticle($article=null) | ||
19 | - { | ||
20 | - | ||
21 | - return ($article==null)? | ||
22 | - new ArticleMicrodata(array_merge(['url'=>123],self::getDefaultSettings())) | ||
23 | - : | ||
24 | - new ArticleMicrodata(array_merge($article,['url'=>123],self::getDefaultSettings())); | ||
25 | - } | ||
26 | - public static function createJsonFromOrganization($article=null) | ||
27 | - { | ||
28 | - | ||
29 | - return ($article==null)? | ||
30 | - new OrganizationMicrodata(array_merge(self::getDefaultSettings())) | ||
31 | - : | ||
32 | - #die(var_dump(self::getDefaultSettings())); | ||
33 | - #die(var_dump(array_merge($article,self::getDefaultSettings()))); | ||
34 | - new OrganizationMicrodata(array_merge($article, | ||
35 | - self::getDefaultSettings())); | ||
36 | - } | ||
37 | - | ||
38 | - | ||
39 | - | ||
40 | - | ||
41 | - | ||
42 | - | ||
43 | - protected static function getDefaultSettings(){ | ||
44 | - return [ | ||
45 | - 'context'=>"http://schema.org", | ||
46 | - | ||
47 | - ]; | ||
48 | - | ||
49 | - | ||
50 | - | ||
51 | - } | ||
52 | - | ||
53 | -} | ||
54 | \ No newline at end of file | 9 | \ No newline at end of file |
10 | + public static function createJsonFromProduct($product) | ||
11 | + { | ||
12 | + return ( $product == null ) ? new ProductMicrodata( | ||
13 | + array_merge([ 'url' => 123 ], self::getDefaultSettings()) | ||
14 | + ) : new ProductMicrodata(array_merge($product, [ 'url' => 123 ], self::getDefaultSettings())); | ||
15 | + } | ||
16 | + public static function createJsonFromArticle($article = null) | ||
17 | + { | ||
18 | + | ||
19 | + return ( $article == null ) ? new ArticleMicrodata( | ||
20 | + array_merge([ 'url' => 123 ], self::getDefaultSettings()) | ||
21 | + ) : new ArticleMicrodata(array_merge($article, [ 'url' => 123 ], self::getDefaultSettings())); | ||
22 | + } | ||
23 | + public static function createJsonFromOrganization($article = null) | ||
24 | + { | ||
25 | + | ||
26 | + return ( $article == null ) ? new OrganizationMicrodata( | ||
27 | + array_merge(self::getDefaultSettings()) | ||
28 | + ) : #die(var_dump(self::getDefaultSettings())); | ||
29 | + #die(var_dump(array_merge($article,self::getDefaultSettings()))); | ||
30 | + new OrganizationMicrodata( | ||
31 | + array_merge( | ||
32 | + $article, | ||
33 | + self::getDefaultSettings() | ||
34 | + ) | ||
35 | + ); | ||
36 | + } | ||
37 | + | ||
38 | + protected static function getDefaultSettings() | ||
39 | + { | ||
40 | + return [ | ||
41 | + 'context' => "http://schema.org", | ||
42 | + | ||
43 | + ]; | ||
44 | + | ||
45 | + } | ||
46 | + | ||
47 | + } | ||
55 | \ No newline at end of file | 48 | \ No newline at end of file |
frontend/views/service/view.php
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | use artbox\core\helpers\ImageHelper; | 10 | use artbox\core\helpers\ImageHelper; |
11 | use artbox\core\helpers\Url; | 11 | use artbox\core\helpers\Url; |
12 | use artbox\core\models\Alias; | 12 | use artbox\core\models\Alias; |
13 | + use common\models\Language; | ||
13 | use common\models\Service; | 14 | use common\models\Service; |
14 | use yii\web\View; | 15 | use yii\web\View; |
15 | 16 |