-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
126 lines (90 loc) · 3.97 KB
/
README
File metadata and controls
126 lines (90 loc) · 3.97 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# sfTodoPlugin #
Add a simple list of tasks easily with this plugin.
Like it? Contribute!
Follow/Fork the project at github: https://github.com/marciotoze/sfTodoPlugin
## Installation ##
* Install the plugin (via a package)
symfony plugin:install sfTodoPlugin
* Install the plugin (via a Subversion checkout)
* Activate the plugin
[php]
#config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins(array(
'sfDoctrinePlugin',
'sfTodoPlugin',
'...'
));
}
}
* Rebuild your model
symfony doctrine:build-model
symfony doctrine:build-sql
* Update you database tables by starting from scratch (it will delete all
the existing tables, then re-create them):
symfony doctrine:insert-sql
* Load default fixture (Optional, but recommended)
symfony doctrine:data-load frontend # replace frontend with the name of one of your application
or do everything with one command
symfony doctrine-build-all-reload frontend # replace frontend with the name of one of your application
* Enable module in your `settings.yml`
all:
.settings:
enabled_modules: [default, todo, ...]
* Clear you cache
symfony cc
* Finally add the component into `layout template` or `module template` you want
[php]
#app/frontend/templates/layout.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
<?php include_stylesheets() ?>
<?php include_javascripts() ?>
</head>
<body>
<?php echo $sf_content ?>
<?php include_component('todo', 'index') ?> #
</body>
</html>
## Configuration ##
* Pre-formated theme
You can remove a pre-formated layout of Todo-List just by setting the parameter formated to false in `plugins/sfTodoPlugin/config/app.yml`
all:
sf_todo_plugin:
formated: false #if true, the component will load a css to pre-format the Todo-List
* Integration with sfDoctrineGuardPlugin
You can integrate Todo-List with sfDoctrineGuardPlugin setting the parameter use_sf_doctrine_guard to true in `plugins/sfTodoPlugin/config/app.yml`
all:
sf_todo_plugin:
use_sf_doctrine_guard: true #if true, each guard user will see one Todo-List, but the list will only work with authenticated user.
* fixing the integration (Optional, but recommended)
if you are using the sfDoctrineGuardPlugin integration then you should fix a database relation by adding the following lines in `plugin/config/schema.yml`
Tasks:
options:
symfony:
filter: false
actAs:
Timestampable: ~
columns:
name: { type: string(255) }
sf_guard_user_id: { type: integer }
priority_id: { type: integer, notnull: true }
status: { type: boolean, default: true }
relations:
Priority: { local: priority_id, foreign: id, foreignAlias: Users, onDelete: CASCADE }
sfGuardUser: #Fixing relationship
Priority:
columns:
name: { type: string(255), notnull: true }
options:
symfony:
filter: false
regenerate the database and you'll be ok. :)