Wednesday, June 28, 2017
Tuesday, June 27, 2017
how to upload image in laravel
in main function
if (Input::hasFile('image'))
{
$getUpload = $this->uploadFile($imageNameWanted);
if($getUpload){
$UpdateProductImage = PackProduct::find($productId)->update(array('image' =>$imageNameWanted));
}
else {
return Redirect::back()->withErrors('Wrong format of image file')->withInput();;
}
}
use this function in main function
public function uploadFile($imageNameWanted)
{
$destinationPath=base_path().'/public/awesome-assets/img/pdfs/';
$uploadResult = Input::file('image')->move($destinationPath,$imageNameWanted);
if($uploadResult)
{
return true;
}
else {
return false;
}
}
Monday, June 19, 2017
Short relationship in laravel
In usersubscription model
class UserSubscription extends Ardent {
use SoftDeletingTrait;
protected $softDelete = true;
protected $dates = ['deleted_at'];
public static $rules = array(
'user_id' => 'required|numeric',
'order_id' => 'numeric',
'product_id' => 'numeric',
'currency' => 'required',
'shipping_amount' => 'required|numeric',
'net_amount' => 'required|numeric',
'pst_amount' => 'required|numeric',
'gst_amount' => 'required|numeric',
'discount_amount' => 'numeric',
'total_amount' => 'required|numeric',
'start_date' => 'required|date',
'next_date' => 'required|date',
'last_date' => 'date',
'end_date' => 'date',
'completed_orders' => '',
'repeat_unit_type' => '',
'repeat_every_x_units' => 'numeric',
'is_active' => 'required|in:0,1',
'number_of_attempts' => 'numeric',
'last_error_text' => '',
'cancellation_reason_id'=> '',
'custom_cancellation_reason'=> '',
);
{
return $this->belongsTo('CancellationReason', 'cancellation_reason_id');
}
//END OF Usersubscription model
// BEGIN OF CANCELLATION REASON MODEL
class CancellationReason extends Eloquent {
use SoftDeletingTrait;
protected $softDelete = true;
protected $dates = ['deleted_at'];
public static $rules = array(
'reason' => 'required',
'has_custom_text' => '',
);
protected $fillable = array(
'reason',
'has_custom_text',
);
public function userSubscriptions()
{
return $this->hasMany('UserSubscription');
}
/**
* Model bootstrap
*/
public static function boot()
{
// make the parent (Eloquent) boot method run
parent::boot();
}
}
@if($subscription->cancellationReason)
{{$subscription->cancellationReason->reason}}
@endif
Tuesday, June 13, 2017
Needed component
needed component
how to create theme in joomla
https://code.tutsplus.com/tutorials/how-to-build-a-joomla-template-start-to-finish--net-15511How do you add a new module position?
Inserting the code
- Open the index.php file of the Template you wish to edit
- Locate the place in the Template where you wish to put the new position.
- Insert
<jdoc:include type="modules" name="newposition" />
- The variable can be used (between existing tags) to replace an image by replacing the <img src="xxx" border="0" alt="">. Or By creating a new tag with its own class/id.
- Open the Template's TemplateDetails.xml file and locate the
<positions></positions> Start and end tags
- Then add
<position>newposition</position>
- Example
<positions> <position>debug</position> <position>position-0</position> <position>position-1</position> <position>position-2</position> <position>position-3</position> <position>position-4</position> <position>position-5</position> <position>position-6</position> <position>position-7</position> <position>position-8</position> <position>position-9</position> <position>position-10</position> <position>position-11</position> <position>position-12</position> <position>position-13</position> <position>position-14</position> <position>position-15</position> <position>newposition</position> </positions>
https://docs.joomla.org/How_do_you_add_a_new_module_position%3F
How to display horizontally menu in protostar Joomla template
protostar template
want to display the main menu at the navigation section
go to the module and change the position at the right position
then go the menu assigement section and add class ' nav-pills' into the class
It will shows the pills menus.
want to display the main menu at the navigation section
go to the module and change the position at the right position
then go the menu assigement section and add class ' nav-pills' into the class
It will shows the pills menus.
Friday, June 9, 2017
how to reset joomla password
- Find your admin user and click on Edit.
- Copy d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199 into the password field and click on Go.
3.use 'secret' as password and username is:libing
How to include custom js code in joomla
/layouts/template.php in your template
<?php
// bing add this 20170609
$document = JFactory::getDocument();
$document->addScript('templates/fontaine_j3/js/custom.js');
?>
custom.js code
/* Bing added it in 20170421 to get horizontal display */
var $ = jQuery.noConflict();
$(document).ready(function() {
window.onload = function () {
$('#toTop').css("cssText", "text-transform: none !important;");
$('#toTop').text('Retour en haut');
// console.log('set the value to it');
}
});
Monday, June 5, 2017
Custom module
two ways to use module
{loadposition my_address}
{module address}
create custom module
select position as "my_address"
title is address.
How to include article in module
{article 304}[text]{/article}
{loadmodule mod_login,Login Form}
{loadposition my_address}
{module address}
create custom module
select position as "my_address"
title is address.
How to include article in module
{article 304}[text]{/article}
{loadmodule mod_login,Login Form}
Subscribe to:
Posts (Atom)