摘要: public function saveAlbum(Album $album) { $data = array( 'aii_username' => $album->aii_username, 'aii_password' => $album->aii_password, ); $this->checkReg($data['aii_username']); $id = (int)$album->id; if ($id == 0) { $this->in... 阅读全文
posted @ 2013-04-23 14:24 徐耀湘 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 数据库现在我们已经建立好了一个拥有控制器及其方法以及显示层脚本的模块,现在就让我们来看看应用的模型层部分。记住模型层是处于应用中处理核心问题的部分(所以也被称为“业务层”),换句话说,就是处理数据库。我们将会使用Zend\Db\TableGateway\TableGateway这个类,专门对数据库进行增、删、改、查的作用。我们通过PHP的PDO方式来连接MySQL,然后创建一个名为“zf2tutorial”的数据库,执行下面的SQL语句来创建封面表,并且插入一些数据进去。CREATE TABLE album ( id int(11) NOT NULL auto_increment, artis 阅读全文
posted @ 2013-04-23 11:16 徐耀湘 阅读(471) 评论(0) 推荐(0) 编辑
摘要: zend framework2使用教程【一】-安装一、前往:http://www.zendframework.com/downloads/latest,下载最新版zf,当前教程使用版本为2.1.0二、在你的web根目录新建文件夹zf,将压缩包中的内容解压缩到zf文件夹中三、前往:https://nodeload.github.com/zendframework/ZendSkeletonApplication/zip/master,下载zf2的教程目录。将压缩包的文件解压到zf文件夹以上三部完成后,你的zf文件夹中的目录结构应该如下:四、打开你的apache的httpd.conf文件夹,在文件的 阅读全文
posted @ 2013-04-23 10:03 徐耀湘 阅读(644) 评论(0) 推荐(0) 编辑
摘要: <?phpreturn array( 'modules' => array( 'Application', 'Album', ), 'module_listener_options' => array( 'config_glob_paths' => array( 'config/autoload/{,*.}{global,local}.php', ), 'module_paths' => array( './module', '. 阅读全文
posted @ 2013-04-23 09:55 徐耀湘 阅读(155) 评论(0) 推荐(0) 编辑
摘要: return array( 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=zf2tutorial;hostname=localhost', 'username' => 'rob', 'password' => '123456', 'driver_options' => array( PDO::MYSQL_ATTR_INIT_COMMA 阅读全文
posted @ 2013-04-22 22:43 徐耀湘 阅读(215) 评论(0) 推荐(0) 编辑
摘要: function check_login(){session_start(); if($_SESSION['author'] != 'aiicms_ok') { header('Location:./admin_login.php'); }} 阅读全文
posted @ 2013-04-22 17:37 徐耀湘 阅读(135) 评论(0) 推荐(0) 编辑
摘要: <?phpreturn array( 'modules' => array( 'Application', 'Album', ), 'module_listener_options' => array( 'config_glob_paths' => array( 'config/autoload/{,*.}{global,local}.php', ), 'module_paths' => array( './module', '. 阅读全文
posted @ 2013-04-19 11:23 徐耀湘 阅读(173) 评论(0) 推荐(0) 编辑
摘要: CREATE TABLE album ( id int(11) NOT NULL auto_increment, artist varchar(100) NOT NULL, title varchar(100) NOT NULL, PRIMARY KEY (id));INSERT INTO album (artist, title) VALUES ('The Military Wives', 'In My Dreams');INSERT INTO album (artist, title) VALUES ('Adele', '21' 阅读全文
posted @ 2013-04-19 10:28 徐耀湘 阅读(225) 评论(0) 推荐(0) 编辑
摘要: config/autoload/global.phpreturn array( 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=album;hostname=localhost', 'username' => 'root', 'password' => '', 'driver_options' => array( PDO::MYSQL_ 阅读全文
posted @ 2013-04-19 10:27 徐耀湘 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 版本php5.4.14 下载地址:http://windows.php.net/downloads/releases/php-5.4.14-Win32-VC9-x86.zipapache2.4.4 下载地址:http://url.cn/CFdoHCmysql5.6.10.1 下载地址:http://www.mysql.com/downloads/installer/zend framework2.1.4 下载地址:http://framework.zend.com/downloads/latestZendSkeletonApplication 下载地址:https://github.com/z 阅读全文
posted @ 2013-04-18 11:02 徐耀湘 阅读(273) 评论(0) 推荐(0) 编辑