How to create a project using openPNE
I don’t know if you have used openPNE. In fact, we can use openPNE to create projects. Today we will introduce the method of creating a project in openPNE. You can refer to it if necessary.
Find the php command under the cmd command prompt
Open "My Computer"->"Properties"->"Advanced "->"Environment Variables"->"System Variables"->"path", edit its value, and add the following path address in front
:
D:\wamp\bin\php\php5.3.0; ===========php编译安装目录
Place php. ini to the C:\Windows directory
Simple building program for symfony
Extract the downloaded symfony compressed package to the www folder and name it symfony
Command line input
e:打开E盘根目录 cd..\.. ===========返回上两级,或打开指定目录 cd wamp\www\symfony ===========打开指定目录 php data\bin\symfony -V ===========查询symfony版本信息 php data\bin\symfony generate:project newProject ===========在www\symfony文件夹下生成一个名叫newProject的新项目 php data\bin\symfony generate:app myApp ===========在该项目的APPS文件夹下生成一个名叫myApp新程序 php data\bin\symfony generate:module myApp myModule ===========在myApp程序文件夹下建立一个名叫myModule的新模块
The symfony command called by php opens the directory where the symfony command is stored relative to the current directory
The action method written in the action class and the access path to the corresponding template mymodule module name myAction action method name
OpenPNE installation
Extract the downloaded compressed package to the server directory
Look for ProjectConfiguration..php. The sample is renamed to ProjectConfiguration..php
Apache service opens the rewrite module
Open the folder where openPNE is located under the cmd command and enter
php symfony openpne:install
APC extension of PHP: if necessary Download php_apc.dll in 115 to the wamp\bin\php\php5.3.0\ext directory
Open the php_apc of the php extension, open php.ini, find extension=php_apc.dll and add in the next line
apc.enabled=0 apc.shm_segments=0 apc.enable_cli=0
If there is a cache folder in the root directory, clear the contents in the cache
Create a program
cmd input
php symfony opGenerate:plugin opVotePlugin ===========创建一个vote插件程序 php symfony opGenerate:app opVotePlugin pc_frontend ===========为vote插件程序创建电脑前台文件夹 php symfony opGenerate:module opVotePlugin pc_frontend vote ===========在vote插件程序电脑前台文件夹内创建vote模块 php symfony cc ===========清除一次缓存
action actions and access rights
Create an opVotePluginVoteActions..php file in the plugins\opVotePlugin\lib\actions directory
Write the class class opVotePluginVoteActions sfActions{}## in the file
#Then the class in the opVotePlugin\apps\pc_frontend\modules\vote\actions\actions..php file inherits the class just written voteActions opVotePluginVoteActions{}Not only the computer frontend In the pc_frontend folder, all mobile computer front and back module actions under opVotePlugin\apps can inherit this class to implement one class to manage multiple front endsCreate plugins\opVotePlugin\apps\pc_frontend\modules\vote\ config\security.yml file and enter all: is_secure: on credentials: SNSMember means that this module requires verification and only members can access it Write an action in the opVotePluginVoteActions class executeShow(sfWebRequest){}Then create plugins\opVotePlugin\apps\pc_frontend\modules\vote\templates\showSuccess.php Execute the command php symfony cc onceCreate a database table
Create the plugins/opVotePlugin/config/doctrine/schema.yml file and enteroptions: charset: utf8 VoteQuestion: actAs: [Timestampable] columns: id: { type: (4), primary: , autoincrement: } member_id: { type: (4), notnull: } title: { type: (140), notnull: } body: { type: } relations: Member: { onDelete: cascade } VoteQuestionOption: columns: id: { type: (4), primary: , autoincrement: } vote_question_id: { type: (4), notnull: } body: { type: (140), notnull: } relations: VoteQuestion: { onDelete: cascade, foreignAlias: VoteQuestionOptions } VoteAnswer: actAs: [Timestampable] columns: id: { type: (4), primary: , autoincrement: } member_id: { type: (4), notnull: } vote_question_id: { type: (4), notnull: } vote_question_option_id: { type: (4), notnull: } body: { type: } relations: Member: { onDelete: cascade } VoteQuestion: { onDelete: cascade, foreignAlias: VoteAnswers } VoteQuestionOption: { onDelete: cascade, foreignAlias: VoteAnswers }
routing rules
create plugins/opVotePlugin/lib/routing/opVotePluginFrontendCollection..phpEnter<?php opVotePluginFrontendRouteCollection sfRouteCollection { __construct( ) { parent::__construct(); ->routes = ( 'vote_list' => sfRequestRoute( '/vote', ('module' => 'vote', 'action' => 'index'), ('sf_method' => ('get')) ), 'vote_new' => sfRequestRoute( '/vote/new', ('module' => 'vote', 'action' => 'new'), ('sf_method' => ('get')) ), 'vote_create' => sfRequestRoute( '/vote/create', ('module' => 'vote', 'action' => 'create'), ('sf_method' => ('post')) ), 'vote_edit' => sfDoctrineRoute( '/vote/edit/:id', ('module' => 'vote', 'action' => 'edit'), ('id' => '\d+', 'sf_method' => ('get')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_update' => sfDoctrineRoute( '/vote/update/:id', ('module' => 'vote', 'action' => 'update'), ('id' => '\d+', 'sf_method' => ('post')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_show' => sfDoctrineRoute( '/vote/show/:id', ('module' => 'vote', 'action' => 'show'), ('id' => '\d+', 'sf_method' => ('get')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_post' => sfDoctrineRoute( '/vote/post/:id', ('module' => 'vote', 'action' => 'post'), ('id' => '\d+', 'sf_method' => ('post')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_delete_confirm' => sfDoctrineRoute( '/vote/delete/:id', ('module' => 'vote', 'action' => 'deleteConfirm'), ('id' => '\d+', 'sf_method' => ('get')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_delete' => sfDoctrineRoute( '/vote/delete/:id', ('module' => 'vote', 'action' => 'delete'), ('id' => '\d+', 'sf_method' => ('post')), ('model' => 'VoteQuestion', 'type' => 'object') ), 'vote_nodefaults' => sfRoute( '/vote/*', ('module' => 'default', 'action' => 'error') ), ); } } ?>
vote: : opVotePluginFrontendRouteCollection options: { name: vote }
The above is the detailed content of How to create a project using openPNE. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

The article discusses symmetric and asymmetric encryption in PHP, comparing their suitability, performance, and security differences. Symmetric encryption is faster and suited for bulk data, while asymmetric is used for secure key exchange.

The article discusses implementing robust authentication and authorization in PHP to prevent unauthorized access, detailing best practices and recommending security-enhancing tools.

Article discusses retrieving data from databases using PHP, covering steps, security measures, optimization techniques, and common errors with solutions.Character count: 159

The article discusses strategies to prevent CSRF attacks in PHP, including using CSRF tokens, Same-Site cookies, and proper session management.

The article discusses the mysqli_query() and mysqli_fetch_assoc() functions in PHP for MySQL database interactions. It explains their roles, differences, and provides a practical example of their use. The main argument focuses on the benefits of usin
