php class opinions extends installer This function update routes publi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
class opinions extends installer
{
//This function update routes
public function addRoutes()
{
return array(
array('before', 'item/show', array(
'<path:\w+>/<company:\w+>/<name:\w+>-opinions.html' => 'opinion/show',
),
),
'action/add-opinion' => 'opinion/add',
);
}
//Add field in table
public function updateModel()
{
return array(
'model' => 'item',
'rules' => array(
array('opinions', 'type', 'int'),
),
);
}
//Move controolers and models to right place
public function updateApp()
{
return array(
'controllers' => array(
'opinion',
),
'model' => array(
'opinion',
),
);
}
}