TAILIEUCHUNG - Tạo mạng xã hội với PHP - part 35

Groups $this-listPublicGroups( 0 ); } } else { if( isset( $urlBits[1] ) ) { $this-listPublicGroups( intval( $urlBits[1] ) ); } else { $this-listPublicGroups( 0 ); } } } /** * Create a new group * @return void */ private function createGroup() { if( isset( $_POST ) && is_array( $_POST ) && count( $_POST ) 0 ) { require_once( FRAMEWORK_PATH . 'models/'); $group = new Group( $this-registry, 0 ); $group-setCreator( $this-registry-getObject('authenticate')getUser()-getUserID() ); $group-setName( $this-registry-getObject('db')sanitizeData( $_POST['name'] ) ); $group-setDescription( $this-registry-getObject('db')sanitizeData( $_POST['description'] ) ); $group-setType( $_POST['type'] ); $group-save(); $this-registry-errorPage('Group created', 'Thank you, your new group has been created'); } else { $this-registry-getObject('template')-buildFromTemplates(. | Groups this- listPublicGroups 0 else if isset urlBits 1 this- listPublicGroups intval urlBits 1 else this- listPublicGroups 0 Create a new group return void private function createGroup if isset _POST is_array _POST count _POST 0 require_once FRAMEWORK_PATH . models group new Group this- registry 0 group- setCreator this- registry- getObject authenticate - getUser - getUserID group- setName this- registry- getObject db - sanitizeData _POST name group- setDescription this- registry- getObject db - sanitizeData _POST description group- setType _POST type group- save this- registry- errorPage Group created Thank you your new group has been created else this- registry- getObject template - buildFromTemplates groups 322 Download from Chapter 10 View The template for creating a group views default templates groups create. is simply a form with a text box for name and description and a drop-down list of types. div id main div id rightside div div id content h1 Create a new group h1 form action groups create method post label for name Name label br input type text id name name name value br label for description Description label br textarea id description name description textarea br label for type Type label br select id type name type option value public Public Group option option value private Private Group option option value private-member-invite Private Invite Only Group option option value private-self-invite Private Self-Invite Group option select br input type submit id create name create value Create group form div div 323 Download from Groups Creating a group in action If we navigate to groups create we see the create group form and are able to successfully create a new group. Viewing a group For us to view a group and also participate in a group we will need A controller for the group A way of maintaining membership lists for groups including A database table A model

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.