How to Configure yiibooster - yii

thanks for reading, i am wondering how to install
YiiBooster
, do i need to install
YiiBootstrap
first ?
I want to install it by hand , is it enough to extract it to extensions folder and than configure the main.php or is there something i am missing ?
Also how can i make this point to the right path
'booster' => array(
'class' => 'path.alias.to.booster.components.Booster',
),

You don't need to install bootstrap. Yiibooster includes all bootstrap files it needs. Just download Yiibooster, unpack to the extension folder and add the below to your main config file,
'booster' => array(
'class' => 'ext.yiibooster.components.Bootstrap',
'responsiveCss' => true,
),
Then add the following in the preload section of the config,
'booster',

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
// preloading 'log' component
'preload'=>array('log','bootstrap'),
// application components
'components'=>array(
//
'bootstrap' => array(
'class' => 'bootstrap.components.Booster',
'responsiveCss' => true,
),

Rename folder name yiibooster-4.0.1 to yiibooster
Step 1:
'preload' => array(
'booster',
),
Step 2:
'booster' => array(
'class' => 'ext.yiibooster.components.Booster',
'responsiveCss' => true,
),
Note: Booster this Class name
//Use view file
<?php
$this->widget('booster.widgets.TbExtendedGridView',
array(
'filter' => $model,
'fixedHeader' => true,
'type' => 'striped bordered',
'headerOffset' => 40,
// 40px is the height of the main navigation at bootstrap
'dataProvider' =>$model->search(),
'template' => "{items}",
'columns' => array(
'id',
'firstname',
'lastname',
'age',
'address',
'email',
),
)
);
?>

Related

CJuiDatePicker in yii is not working

In my web application, I want to implement a date field. For this i am using CJuiDatePicker. But for me it not showing calendar.
My code is,
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name' => 'Employee[employee_joiningdate]',
'id' => 'Employee_employee_joiningdate',
'value' => Yii::app()->dateFormatter->format("d-M-y", strtotime($model->employee_joiningdate)),
'options' => array(`
'showAnim' => 'slide', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
'showOtherMonths' => true, // Show Other month in jquery
'selectOtherMonths' => true, // Select Other month in jquery
),
'htmlOptions' => array(
'class' => 'form-control'
),
));`
What i am doing wrong?
Please help me....
Thanks in advance.

How to print YII Logger without Yii::app()->end

I am using YII 1.0 logger but i am not able to print YII logs without Yii::app()->end.
Below is my test program :
$test = 123;
if($test){
Yii::log('Test', CLogger::LEVEL_INFO, "This is for testing");
}
Below is my configuration settings :
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => 'CFileLogRoute',
'levels' => 'trace, info, error, warning, vardump',
),
array(
'class' => 'CWebLogRoute',
'enabled' => YII_DEBUG,
'levels' => 'error, warning, trace, notice',
'categories' => 'application',
'showInFireBug' => true,
),
array(
'class'=>'CFileLogRoute',
'logFile'=>'custom.log',
'categories'=>'custom.*',
),
),
),
Is there something wrong in my code ?
Thanks in advance.
You may learn CLogger api for more useful information.
Yii::getLogger()->flush(true);
Also hope it helps:
http://www.yiiframework.com/forum/index.php/topic/8671-force-message-routing-before-the-end-of-the-application/
http://www.yiiframework.com/forum/index.php?/topic/8158-logger-and-flush-problem/
Messages can be logged using yii::log,
syntax:
Yii::log($message, $level, $category);
example:
Yii::log("This is for testing","error","custom");

Where can i find a full list of InputeFilters Zend2 properties?

Where i can find a complit list of validator construction properties (factory). For exmple we got 1 inputeFilter 'email':
$this->add(array(
'name' => 'email',
'required' => true,
'validators' => array(
array(
'name' => 'EmailAddress',
'options' => array(
'domain' => true,
),
),
),
));
May be some documentation with all properties ('name', 'requiered. e.t.c.) and their structure.
they are all well documented just not in the array notation http://framework.zend.com/manual/current/en/modules/zend.validator.set.html
also you can view the invokables in the vendor code the variable is called $invokableClasses.
..\vendor\zendframework\zendframework\library\Zend\Validator\ValidatorPluginManager.php
For options you may still look at the documentation since they obviously vary from validator to validator.
Edit: In some cases building the validator out of the array notation is helpful. You'll just have to add them into the inputfilter notation like so:
...
$eanValidator = new Zend\Validator\Barcode(array(
'adapter' => 'EAN13',
'checksum' => false,
));
...
$this->add(array(
'name' => 'ean-test',
'required' => true,
'validators' => array(
array(
$eanValidator,
$someOtherValidator,
...
),
),
));

CClientScript duplicates the output

I'm trying to use this extension in a partial view, in my registration module...
$form->widget('ext.tokenInput.TokenInput', array(
'model' => $model,
'attribute' => 'tags',
'url' => array('wizard/search'),
'options' => array(
'allowCreation' => false,
'preventDuplicates' => true,
'allowFreeTagging' => false,
'minChars' => 2,
'theme' => 'facebook',
)
));
...and assets (javascript and CSS files) are duplicated.
Basically I can see in the HTML code multiple occurrences of these files.
I have the same problem if I try to add custom JS files in the same partial view.
I specify POS_HEAD and I can see the code in <head> and in the middle of the page.
Why CClientScript duplicates assets if I add them in a partial view?
Thanks a lot!

Customize getting data from SugarCRM Custom Module by Query parameter in rest api

Hi I'm trying to get data from SugarCRM by REST api. It's fine with default module, but with custom module, I got a issue.
I used this example
And getting data from Contacts module which has last name = "abc" is ok with these code:
$get_entry_list_parameters = array(
'session' => $session_id,
'module_name' => 'Contacts',
'query' => "contacts.last_name='abc'",
'order_by' => "",
'offset' => '0',
'select_fields' => array(
'id'
),
'link_name_to_fields_array' => array(
),
'max_results' => '1',
'deleted' => '0',
'Favorites' => false,
);
When I tried to get data from our custom module (eg: Event Session inside Event package), so it's ok as well without Query param like these code
$get_entry_list_parameters = array(
'session' => $session_id,
'module_name' => 'event_event_session',
'order_by' => "",
'offset' => '0',
'select_fields' => array(
'id',
'name'
),
'link_name_to_fields_array' => array(
),
'max_results' => '3',
'deleted' => '0',
'Favorites' => false,
);
But after that I put Query param, I got no record
$get_entry_list_parameters = array(
'session' => $session_id,
'module_name' => 'event_event_session',
'query' => "event_event_session.name='def'",
'order_by' => "",
'offset' => '0',
'select_fields' => array(
'id',
'name'
),
'link_name_to_fields_array' => array(
),
'max_results' => '3',
'deleted' => '0',
'Favorites' => false,
);
I think the way I used to get data from custom module is not correct.
Anyone can help me resolve this issue. Thank you!
Johnny
Are you sure the table name for the custom module is "event_event_session"?
When we create any new custom module using module builder then it is asking for key name. So our module will become as key_modulename. So make sure you are passing the key name along with module name. So that way you can access the data of custom new module.