|
Kuliah TKI : Symfony Introduction |
|
|
|
|
Written by Administrator
|
|
Wednesday, 18 June 2008 |
Hari terakhir kuliah Topik Khusu Internet diajarkan tentang beberapa macam PHP framework yang terkenal, yaitu cakephp, zend, dan symfony. Untuk cakephp menggunakan file video dari Pak Sunu Wibarama founder idcake.web.id. Videonya berbahasa Indonesia, jadi ditayangkan di awal kuliah biar mahasiswa gampang mendapatkan gambaran tentang framework (Terima kasih Pak Sunu !) dilanjutkan dengan melihat slide Intro dari Zend, terus slide intro dari Symfony. Setelah itu dilanjutkan mencoba menggunakan symfony dengan instalasi dari sandbox, tapi dengan database mysql. berikut langkah2nya..
- Buat folder baru di www, misal photoalbum - extract sf_sandbox.zip - ambil isi dari sf_sandbox, copykan ke folder photoalbum - Masuk ke flder web, buka .htaccess, edit : - buka komentar RewriteBase - ganti: RewriteRule ^(.*)$ photoalbum/web/index.php [QSA,L] - Buka di browser photoalbum/web -> muncul tampilan symfony project created
- masuk folder config, buka propel.ini untuk mengkonfigurasi database (agar tidak menggunakan sqllite) propel.project = photoalbum propel.database = mysql propel.database.createUrl = mysql://root:mysql@localhost/ propel.database.url = mysql://root:mysql@localhost/photo propel.output.dir = C:\AppServ\www\photoalbum (login mysql dengan usert 'root' dan password 'mysql' ) - buka databases.yml
all: propel: class: sfPropelDatabase param: dsn: mysql://root:mysql@localhost/photo
- buat database di mysql dengan nama photo
- buka folder config, buka schema.yml, tambahkan : propel: photo: id: {type:integer, autoIncrement: true, primaryKey: true } file_path: varchar(50) description: longvarchar created_at: timestamp tag: photo_id: {type:integer, autoIncrement: true, foreignTable: photo, foreignReference: id } name: varchar(50) comment: photo_id: {type:integer, autoIncrement: true, foreignTable: photo, foreignReference: id } author: varchar(50) body: varchar(50) created_at: timestamp
keterangan : jika nama filed dibuat created_at atau updated_at, maka akan secara otomatis diisi oleh symfony.
- masuk command promt, arahkan ke c:\appserv\www\photoalbum
symfony propel-build-schema symfony propel-build-model sympony propel-build-sql
- masukkan model ke mysql mysql -u root -p photo < data/sql/lib.model.schema.sql
- generaet halaman admin symfony propel-init-admin frontend photo Photo
browse http://localhost/photoalbum/web/index.php/photo
|
Kuliah TKI - Blog da...
mm Apparently, 21,000 boots imported by
Clas-class php yang ...
mm Apparently, 21,000 boots imported by
Kuliah TK Internet :...
mm Apparently, 21,000 boots imported by
The Power of GIS - U...
mm Apparently, 21,000 boots imported by
Kuliah TK Internet :...
mm Apparently, 21,000 boots imported by
JPGraph - membuat gr...
timberland - mm Apparently, 21,000 bo...
Kuliah TKI : Ajax - ...
mm Apparently, 21,000 boots imported by
Banner spesial untuk...
mm Apparently, 21,000 boots imported by