本文整理汇总了PHP中Convert::makeLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Convert::makeLink方法的具体用法?PHP Convert::makeLink怎么用?PHP Convert::makeLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Convert
的用法示例。
在下文中一共展示了Convert::makeLink方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exeAdd
function exeAdd()
{
$id = (int) Session::get('user')['id'];
if ($id > 0) {
$error = '';
if (!empty($_FILES)) {
$upload = new Upload('file');
$upload->setFileExtension('jpg|jepg|png|gif');
$upload->setUploadDir('public/uploads/members/');
$upload->setFileSize(2048);
$e = $upload->getError();
if (!empty($e)) {
foreach ($e as $value) {
$error .= $value . '<br />';
}
}
if ($error != '') {
$message = '<div class="album" status="true"><p class="red">' . $error . '</p></div>';
} else {
$imageName = Convert::makeLink($_FILES['file']['name']);
$imageLink = $upload->uploads($imageName);
$id = $this->model->add(Session::get('user')['username'], $imageName, $imageLink);
$message = '<div class="album" imageId="' . $id . '">
<img src="' . BASE_URL . '/' . $imageLink . '" alt="' . $imageName . '" class="imgage" />
<span class="img-delete" imageId="' . $id . '" title="Xoá ảnh này">X</span>
<p>Ngày đăng: ' . date('d-m-Y H:i', time()) . '</p>
</div>';
}
} else {
$message = '<div class="album" status="true"><p class="red">Bạn chưa chọn file</p></div>';
}
echo $message;
} else {
Until::redirectTo();
}
}
示例2: foreach
<h2>Hỗ trợ</h2>
<ul class="categories_list">
<?php
foreach ($supports as $sp) {
echo '<li><a href="' . $detail . $sp['id'] . '-' . Convert::makeLink($sp['question']) . '">' . $sp['question'] . '</a></li>';
}
?>
</ul>
示例3: foreach
<div class="content_section">
<h2><?php
echo '<h2>' . $service['feature'] . '</h2>';
?>
</h2>
<?php
if (empty($article)) {
echo '<p>Chưa có bài viết nào</p>';
} else {
foreach ($article as $value) {
echo '<h3><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['title']) . '">' . $value['title'] . '</a></h3>';
echo '<div>' . $value['quote'] . '</div>';
echo '<div class="button_01"><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['title']) . '">Xem thêm</a></div>
<div class="cleaner_h20"></div>';
}
?>
<?php
}
?>
</div>
示例4: exeChangeAvatar
function exeChangeAvatar()
{
$id = (int) Session::get('user')['id'];
if ($id > 0) {
$error = '';
if (!empty($_FILES)) {
$upload = new Upload('file');
$upload->setFileExtension('jpg|jepg|png|gif');
$upload->setUploadDir('public/uploads/avatar/');
$upload->setFileSize(1024);
$e = $upload->getError();
if (!empty($e)) {
foreach ($e as $value) {
$error .= $value . '<br />';
}
}
if ($error != '') {
$message = '<p class="red">' . $error . '</p>';
} else {
$imageName = Convert::makeLink($_FILES['file']['name']);
$imageLink = $upload->uploads($imageName);
$this->model->changeAvatar(Session::get('user')['id'], $imageLink);
if (Session::get('user')['avatar'] != 'public/uploads/members/member-1.png' || Session::get('user')['avatar'] != 'public/uploads/members/member-1.png') {
if (file_exists(Session::get('user')['avatar'])) {
unlink(Session::get('user')['avatar']);
}
}
$data = Session::get('user');
$data['avatar'] = $imageLink;
Session::set('user', $data);
$message = '1';
}
} else {
$message = '<p class="red">Bạn chưa chọn file</p>';
}
echo $message;
} else {
Until::redirectTo();
}
}
示例5: exeInsert
public function exeInsert()
{
if (isset($_POST['submit'])) {
$file = false;
$service = (int) Request::post('services');
$title = Request::post('title');
$content = Request::post('content');
$author = Session::get('user')['username'];
$quote = Request::post('quote');
$pin = (int) Request::post('pin');
$error = '';
if ($title == null) {
$error .= 'Tên bài viết không được trống.<br />';
}
if ($quote == null) {
$error .= 'Trích dẫn không được trống.<br />';
}
if ($content == null) {
$error .= 'Nội dung không được trống.<br />';
}
if ($_FILES['file']['tmp_name'] != null) {
$upload = new Upload('file');
$upload->setFileExtension('jpg|jepg|png|gif');
$upload->setUploadDir('public/uploads/articles/');
$upload->setFileSize(1024);
$e = $upload->getError();
if (!empty($e)) {
foreach ($e as $value) {
$error .= $value . '<br />';
}
}
$file = true;
}
if ($error != '') {
Session::set('article', $_POST);
Session::set('error', $error);
Until::redirectTo('article/add');
} else {
$imageName = '';
$imageLink = '';
if ($file) {
$imageName = Convert::makeLink($title);
$imageLink = $upload->uploads($imageName);
}
$id = $this->model->add($service, $title, $content, $author, $quote, $imageName, $imageLink, $pin);
Until::redirectTo('article/detail?id=' . $id);
}
} else {
Until::redirectTo();
}
}
示例6: foreach
}
?>
<div class="cleaner_h10"></div>
<h2>Danh sách bạn</h2>
<div id="friends">
<?php
if (empty($friends)) {
echo 'Không có bạn bè';
} else {
foreach ($friends as $value) {
if ($id == $value['userA']) {
echo '<div class="member" userId="' . $value['userB'] . '">
<a href="' . $detail . $value['userB'] . '-' . Convert::makeLink($value['fullnameA']) . '">
<img src="' . $value['avatarB'] . '" class="image"></a>
<p><a href="' . $detail . $value['userB'] . '-' . Convert::makeLink($value['fullnameA']) . '">' . $value['fullnameB'] . ' (' . (getdate()['year'] - $value['bornB']) . ' tuổi)</a></p>
<p><span class="rlsDelete" userId="' . $value['userB'] . '" >Huỷ bạn bè</span></p>
</div>';
} else {
echo '<div class="member" userId="' . $value['userA'] . '">
<a href="' . $detail . $value['userA'] . '-' . Convert::makeLink($value['fullnameA']) . '">
<img src="' . $value['avatarA'] . '" class="image"></a>
<p><a href="' . $detail . $value['userA'] . '-' . Convert::makeLink($value['fullnameA']) . '">' . $value['fullnameA'] . ' (' . (getdate()['year'] - $value['bornA']) . ' tuổi)</a></p>
<p><span class="rlsDelete" userId="' . $value['userA'] . '">Huỷ bạn bè</span></p>
</div>';
}
}
}
?>
</div>
<div class="cleaner_h10"></div>
</div>
示例7:
if ($data['imageLink'] != null) {
echo '<img src="' . BASE_URL . '/' . $data['imageLink'] . '" alt="' . $data['imageName'] . '" title="' . $data['title'] . '">';
}
?>
<div>
<?php
echo $data['quote'];
?>
</div>
<div class="cleaner"></div>
<div class="button_01">
<a href="<?php
echo $detailArticle . $data['id'] . '-' . Convert::makeLink($data['title']);
?>
">Xem thêm</a>
</div>
<div class="cleaner_h20"></div>
<?php
} else {
echo '<p><a href="' . $detailArticle . $data['id'] . '-' . Convert::makeLink($data['title']) . '" >' . $data['title'] . '</a></p>';
}
$i++;
}
?>
</div>
<div class="cleaner"></div>
示例8: foreach
<h2>Dịch vụ</h2>
<ul class="categories_list">
<?php
foreach ($services as $value) {
echo '<li><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['feature']) . '">' . $value['feature'] . '</a></li>';
}
?>
</ul>