PHP code example of zjh / portrait

1. Go to this page and download the library: Download zjh/portrait library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zjh / portrait example snippets


public function actions()
{
    'headpic'=>[
		'class'=>'zjh\portrait\PortraitAction',
		'config' => [ 
			'imageRoot' =>Yii::getAlias('@webroot'),//��Ŀ¼��ַD://webpath/
			"publicPath"=>"/uploads/public/original/",//ԭͼ����·��
			"publicHeadpicPath"=>"/uploads/public/headpic/",//Ĭ��ͷ�񱣴�·��
			"publicTmpPath"=>"/uploads/public/headpicTmp/",//Ĭ��ͷ�񱣴�·��
			'CConfig' => [
				"width" => 120,
				"height" => 120
			],//����ͷ���С����
			'maxsize'=>1024*1024*2,//2M�ϴ�ͼƬ���ߴ�
			'userModelTableName'=>'user_backend',//��Ҫ�޸�ͷ����û�ģ��
			'portraitKeyword'=>'thumb',//�û���Ҫ�޸ĵĹؼ���
		]
	],
}

$ php composer.phar