dojo TabContainer via zend render no thing - dojo

I have mess all day with this decorator, i read many source to implement dojo tab container via zend framework, but i tried it self result nothing.
is there any misscode with this snippet
$form = new Zend_Dojo_Form();
$form->setName('name')
->setLegend('legend')
;
$form->setDecorators(array(
'formElements',
array('tabContainer', array(
'id' => 'tabContainer',
'style' => 'width: 600px; height: 500px;',
'dijitParams' => array(
'tabPosition' => 'top'
),
)),
'DijitForm',
));
$a = new Zend_Dojo_Form_Element_TimeTextBox('time');
$a->setLabel('label');
$sf = new Zend_Dojo_Form_SubForm();
$sf->setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' => 'dl')),
'ContentPane',
));
$sf->addElement($a);
$form->addSubForm($sf, 'subform');
thanks before

this?
or this?
Dojo view helpers in Zend use captureStart() and captureEnd()

Related

Making a dynamic Form in Prestashop

What I want to achieve Image! Hi I am working on a module in prestashop. What I want is that there should be a button (any-name: Add new field) in the backoffice-(Module Configuration page the first page that comes when you configure your module) that the user presses and it should add a new input field in the form. This all should be done using the helper classes. How can I achieve that? Some code would be grateful! I have uploaded an image. I have tried it using jQuery and it works but I need this done using helperForms in prestashop! In jQuery if I press the add new field button it adds an input field dynamically but the helper-classes are not used in that case.
Here is a link to the documentation :
http://doc.prestashop.com/display/PS16/Using+the+Helper+classes
the documentation is for PS 1.6 but it should also work with PS 1.7
Here is an example of code that generate a form with Helper Classes :
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Edit carrier'),
'image' => '../img/admin/icon_to_display.gif'
),
'input' => array(
array(
'type' => 'text',
'name' => 'shipping_method',
),
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default pull-right'
)
);
I don’t know if you can use Helper class for custom forms that update custom datas. I’m sure you can use them to update module configuration and prestashop object (customer, etc.)
Helper classes enable you to generate standard HTML elements for the
back office as well as for module configuration pages.

New page from HTML in kartik\mpdf (Yii2)

I have a problem. How to add a new page from HTML to PDF?
Immediately I will say that I do not know why, but solutions such as:
<pagebreak />
or
h1 {page-break-before: always}
not working.
My PHP Code:
$pdf = new Pdf([
'mode' => Pdf::MODE_UTF8,
'format' => Pdf::FORMAT_A4,
'orientation' => Pdf::ORIENT_PORTRAIT,
'destination' => Pdf::DEST_FILE,
'filename' => $path,
'content' => $content,
'cssInline' => '.font_next{font-family:DoodlePen}table{border-collapse:collapse;width:100%}td{border:1px solid #000}',
]);
return $pdf->render();
Does anyone have this experience and can help you?
From the docs, looks like you can either use HTML like:
<pagebreak />
or
<tocpagebreak />
Or PHP:
$mpdf->AddPage();
$mpdf->TOCpagebreak();
But you already said you tried the html and din't work. Maybe you have a parent element with float?
OK, it works.
I use this method: https://davidwalsh.name/css-page-breaks
In HTML:
<div className="page-break"></div>
In PHP:
$pdf = new Pdf([
'mode' => Pdf::MODE_UTF8,
'format' => Pdf::FORMAT_A4,
'orientation' => Pdf::ORIENT_PORTRAIT,
'destination' => Pdf::DEST_FILE,
'filename' => $path,
'content' => $content,
'cssInline' => '
#media all{
.font_next{font-family:DoodlePen}table{border-collapse:collapse;width:100%}td{border:1px solid #000}.page-break {display: none;}
}
#media print{
.page-break{display: block;page-break-before: always;}
}
',
]);
return $pdf->render();

using Csqldataprovider CGridView and CButtonColumn (Yii Framework) dont appear

i have got a gridview using the Csqldataprovider but then unlike CAtiveDataProvider default cButton column doesnt appear i did write the custom code to it
array(
'class'=>'zii.widgets.grid.CButtonColumn',
'viewButtonUrl'=>'Yii::app()->createUrl("/Controllername/view",array("id"=>$data["mid"]))',
),
as well am not rendering $data["mid"] in the gridview
but yet browser renders
PHP notice
Trying to get property of non-object
...yii\framework\base\CComponent.php(612) : eval()'d code(1)
can anyone tell me what am i missing
try something like this
array(
'class'=>'CButtonColumn',
'buttons'=>array(
'delete'=>array(
'url'=> 'your/ url',
),
'update'=>array(
'url'=> 'your/ url',
),
'view'=>array(
'url'=>'your/ url',
),
),
),
try
array('header'=>'Modifies',
'headerHtmlOptions' => array('style' => 'background-color:#E4E7E8'),
'htmlOptions' => array('style' => 'width:55px'),
'class'=>'zii.widgets.grid.CButtonColumn',
'viewButtonUrl'=>'Yii::app()->createUrl("/account/view", array("id"=>$data["id"]))',
'updateButtonUrl'=>'Yii::app()->createUrl("/account/editDealer", array( "d789#_5%1%d" => $data["id"]))',
'deleteButtonUrl'=>'Yii::app()->createUrl("/account/deleteDealer", array("d!7_#371%d"=>$data["id"]))',
),

YII - define extracted bootstrap in config file

i'm new in Yii. and i'm using this LINK.
i'm extracted bootstrap on /blog/protected/extensions directory and define array into config/main.php like this:
//BOOT STRAP
'clientScript' => array(
'scriptMap' => array(
'jquery.js'=>false,
'jquery.min.js'=>false,
'core.css'=>false,
'styles.css'=>false,
'pager.css'=>false,
'default.css'=>false,
),
'packages'=>array(
'jquery'=>array(
'baseUrl'=>'bootstrap/',
'js'=>array('js/jquery.js'=>true /* SET AS DEFAULT*/ ),
),
'bootstrap'=>array(
'baseUrl'=>'bootstrap/',
'js'=>array('js/bootstrap.min.js',
'js/bootstrap-transition.js',
'js/bootstrap-alert.js',
'js/bootstrap-modal.js',
'js/bootstrap-dropdown.js',
'js/bootstrap-tab.js',
'js/bootstrap-tooltip.js',
'js/bootstrap-popover.js',
'js/bootstrap-button.js',
'js/bootstrap-collapse.js',
'js/bootstrap-carousel.js',
'js/bootstrap-typeahead.js',
'js/bootstrap-affix.js',
'js/holder.js',
'js/prettify.js',
'js/application.js',
),
'css'=>array(
'css/bootstrap.min.css',
'css/custom.css',
'css/bootstrap-responsive.min.css',
),
'depends'=>array('jquery'),
),
),
),
//BOOT STRAP
how to change 'baseUrl'=>'bootstrap/' to correct path of extension? this path does not work:
'baseUrl'=>'/protected/extensions/bootstrap/',
If you are new, learn about extensions.
Than download ready yii extension for bootstrap: Yii-Bootstrap or Yii-Booster.
You don't have to define any js package, bootstrap extension will do it for you.
Here is sample config part for yii-booster, which i use (actually for yii-bootstrap it should be same):
'components' => array(
// ... other components
'bootstrap' => array(
'class' => 'ext.bootstrap.components.Bootstrap',
'coreCss' => true,
'responsiveCss' => true,
'yiiCss' => true,
),
),
// .. other components
And thats it! Bootstrap will work.

ZendDeveloperTools module not displaying a toolbar in ZF2 beta5

I'm trying to install the ZendDeveloperTools modules for ZF2 beta5. Here are the steps I followed so far:
-Successfully installed ZendSkeletonApplication.
-Downloaded the module into my ./vendor directory.
-Enabled the module in ./config/application.config.php:
<?php
return array(
'modules' => array(
'Application',
'ZendDeveloperTools', // Added this line
),
'module_listener_options' => array(
'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php',
),
'module_paths' => array(
'./module',
'./vendor',
),
),
);
-Copied ./vendor/ZendDeveloperTools/config/zenddevelopertools.local.php.dist to ./config/autoload/zenddevelopertools.local.php.
-Edited zenddevelopertools.local.php as follows:
<?php
return array(
'zdt' => array(
'profiler' => array(
'enabled' => true,
'strict' => true,
'verbose' => true,
'flush_early' => false,
'cache_dir' => 'data/cache',
'collectors' => array(),
'verbose_listeners' => array('application' => array(
'ZDT_TimeCollectorListener' => true,
'ZDT_MemoryCollectorListener' => true,
))
),
'toolbar' => array(
'enabled' => true,
'auto_hide' => false,
'position' => 'bottom',
'version_check' => false,
'entries' => array(),
),
),
);
-Added define('REQUEST_MICROTIME', microtime(true)); in my ./public/index.php
-Replaced my ./composer.json with the one provided in the ZendDeveloperTools module.
-Removed the , at the end of line 29 which was causing problems (shouldn't be there):
-Ran a composer update :
$ php composer.phar update
Updating dependencies
- Updating zendframework/zendframework (dev-master)
Checking out 9f4dd7f13c8e34362340072d0e2d13efe15e4b1f
Writing lock file
Generating autoload files
-Added error_reporting(E_ALL); ini_set('display_errors', '1'); to ./public/index.php to catch potential errors
When I access my application I don't get any errors (I get the skeleton application home page) but the zend developer toolbar isn't show up
What am I missing to make use of and display the zend developer toolbar?
It was a stupid mistake, I had placed zenddevelopertools.local.php into ./config and not ./config/autoload. Above instructions are correct. Here is what the toolbar looks like for those who are curious:
Worked for me, but one change I had to make for my app was rename the config from:
zenddevelopertools.local.php
to:
zenddevelopertools.local.config.php
Also, I installed BjyProfiler, which "just worked" with my Doctrine2 setup (nice!). The only caveat was that I had to add the default SM factory config so it would stop throwing errors:
'service_manager' => array(
'factories' => array(
/**
* This default Db factory is required so that ZDT
* doesn't throw exceptions, even though we don't use it
*/
'Zend\Db\Adapter\Adapter' => function ($sm) use ($dbParams) {
$adapter = new BjyProfiler\Db\Adapter\ProfilingAdapter(array(
'driver' => 'pdo',
'dsn' => 'mysql:dbname=skunk;host=hunk',
'database' => 'bunk',
'username' => 'junk',
'password' => 'punk',
'hostname' => 'lunk',
));
$adapter->setProfiler(new BjyProfiler\Db\Profiler\Profiler);
$adapter->injectProfilingStatementPrototype();
return $adapter;
},
),
),
See the screenshot: