I am not getting any output html from below code
$this->widget('zii.widgets.CListView', array(
'id'=>'skills-grid',
'itemView'=>'scheduled_skills',
'dataProvider'=>$model->search(),
));
Is there any demo available for listview example in yii1.1?
Please share the links for listview example in yii1.1
You can used this code for ClistView in Yii1.1
Clistview File for ex : index.php
$this->widget('zii.widgets.CListView', array(
'id'=>'skills-grid',
'itemView'=>'_scheduled_skills', // Your View file
'dataProvider'=>$model->search(),
));
ClistView View file for ex : _scheduled_skills.php
<table class="table">
<tbody>
<tr>
<td><span class="title"><strong> First Name</strong> </span></td>
<td><span class="title"><?php echo $data->first_name;?></td>
</tr>
<tr>
<td><span class="title"><strong>Last Name</strong> </span></td>
<td><span class="title"><?php echo $data->last_name;?></td>
</tr>
</tbody>
</table>
You can direct access $data object in ClistView File.
you can refere this Link Yii1 ClistView
Related
I would like to use footable (I've already use footable for its responsive exploding display )and this to show records coming from a database but with a need to have a column (which display the stock quantity of products) that thye user can modify just by typing. Is there any way of having some sort of content editable column....
Any idea will be welcome
You can render the column as HTML, which will prevent footable from taking over the content of the cell, and have an <input type="text" /> for each row.
Something like:
<table>
<thead>
<tr>
<th>Name</th>
<th data-type="html">In stock</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apples</td>
<td><input type="number" step="any" value="3"/></td>
</tr>
<tr>
<td>Oranges</td>
<td><input type="number" step="any" value="0"/></td>
</tr>
</tbody>
</table>
Check the documentation at https://fooplugins.github.io/FooTable/docs/getting-started.html , look for "Column Options" > "Type" .
After rendering you can attach an event listener to the input fields and send ajax calls accordingly.
I am a developer but new to Prestashop (not really familiar with template because i am not a web developer but getting there..) but just helping my friend manage his website.
I checked the current version is 1.5.6 and am trying to add a new fieled in Product table and add another description input area in the following page.
I had a look at Product.php (classes > product.php), AdminProductsController.php (controllers > admin > adminproductscontroller.php) and Products.tpl (themes > uhu023v15 > products.tpl) but none of them seemed relevant to me. Not sure which files I need to modify. Please help.
You need go to
adminXXXX/themes/default/template/controllers/products/informations.tpl
because this is backend template (product.tpl is frontend template and what customer see when view product)
there You will find
<tr>
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="description_short" type="tinymce" multilang="true"}
<label>{l s='Short description:'}<br /></label>
<p class="product_description">({l s='Appears in the product list(s), and on the top of the product page.'})</p>
</td>
<td style="padding-bottom:5px;">
{include file="controllers/products/textarea_lang.tpl"
languages=$languages
input_name='description_short'
input_value=$product->description_short
max=$PS_PRODUCT_SHORT_DESC_LIMIT}
<p class="clear"></p>
</td>
</tr>
<tr>
<td>
**Your HERE** ;)
</td>
</tr>
<tr>
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="description" type="tinymce" multilang="true"}
<label>{l s='Description:'}<br /></label>
<p class="product_description">({l s='Appears in the body of the product page'})</p>
</td>
<td style="padding-bottom:5px;">
{include file="controllers/products/textarea_lang.tpl" languages=$languages
input_name='description'
input_value=$product->description
}
<p class="clear"></p>
</td>
</tr>
From there You need to duplicate whole textarea block and find and duplicate according functions (not sure where)
i am developing web application by using yii framework, i have one table called "userprofile" in my database. i have tried to export userprofile data to excel file, everything is working fine this is my userprofile table fields
user profile table
id username password studentname classid parentname email
1. xxxxx asdf yyyyy 2 pqrs xy#gmail.com
classname table
classid classname
1. xxxxx
2. yyyyy
3. zzzzz
In my controller i have one function called actionExcelexport() and it has
$content = $this->renderPartial("excel",array("model"=>Puserprofile::model()->findAll()),true);
In above line i am calling one excel file called excel and this is my excel.php
<table>
<tr>
<td style="background-color: #555;color:#fff">User Name</td>
<td style="background-color: #555;color:#fff">Student Name</td>
<td style="background-color: #555;color:#fff">ClassID</td>
<td style="background-color: #555;color:#fff">Parent Name</td>
<td style="background-color: #555;color:#fff">Email</td>
</tr>
<?php foreach($model as $data):?>
<tr>
<td> <?php echo $data->username ?> </td>
<td> <?php echo $data->studentname ?> </td>
<td> <?php echo $data->classid ?> </td>
<td> <?php echo $data->parentname ?> </td>
<td> <?php echo $data->email ?> </td>
</tr>
<?php endforeach; ?>
</table>
my reqirement:-
In my excel file i want to get classname instead of classid for example if my classs id is '2', classname 'yyyy' should get in excel file how to retrive classname based on classid could you please help me
i got solution for my problem
In my excel.php, instead of this line
classid ?>
i changed
class->classname?>
class->classname = my userprofile model has relation function and it has some relation because i am using foreign key for my table so i am taking this 'class' from my model and this is ('classname') my database field name
I'm using the scaffold generator of phalcon
it generates table, below is an example of the generated code:
<table>
<tr>
<td align="right">
<label for="id_media">Id Of Media</label>
</td>
<td align="left">
{{ text_field("id_media", "type" : "numeric") }}
</td>
</tr>
<tr>
...
</table>
My question is how to customize the generating process to have a form, with divs instead of a table.
That's possible by modifying the following, depending on your need
Modify the views' files in phalcon-tools/templates/scaffold/no-forms/views
Modify the scaffold.php in /phalcon-tools/scripts/Phalcon/Builder/Scaffold.php
Regards
I'm creating a simple view function, after checking my sql log its correct, However my view is not printing the information.
SELECT `AccountsUser`.`id`, `AccountsUser`.`account_id`
FROM `pra`.`accounts_users` AS `AccountsUser`
WHERE `user_id` = 14
SELECT `Template`.`id`, `Template`.`name`, `Template`.`description`,
`Template`.`account_id`
FROM `pra`.`templates` AS `Template`
WHERE `Template`.`account_id` = (10)
The account_id=10 but it isn't printing out the templates related to the account.id
function view(){
$this->set('title_for_layout', 'View Templates');
$this->set('stylesheet_used', 'homestyle');
$this->set('image_used', 'eBOXLogoHome.jpg');
$this->layout='home_layout';
$this->Template->unbindModel(array('belongsTo'=>array('Account')));
$templates = $this->Auth->user('name');
$accounts=$this->User->AccountsUser->find('list', array('fields'=>array('id', 'account_id'),'conditions' => array('user_id' => $this->Auth->user('id'))));
$templates=$this->Template->find('all', array('conditions' => array('Template.account_id' => $accounts)));
$this->set('template', $templates);
$this->set('account'. $accounts);}
Here is the view
<table width="100%" border="1">
<table width="100%" border="1">
<tr>
<th>Template Name</th>
<th>Template Description</th>
</tr>
<?php foreach($template as $templates): ?>
<tr>
<td align='center'><?php echo $templates['templates']['id']; ?> </td>
<td align='center'><?php echo $templates['templates']['name']; ?> </td>
</tr>
<?php endforeach; ?>
</table>
id like it to print a list of templates related to the account.id
You should try the following:
<table width="100%" border="1">
<tr>
<th>Template Name</th>
<th>Template Description</th>
</tr>
<?php if(!empty($template))
{
foreach($template as $templates)
{?>
<tr>
<td align='center'><?php echo $templates['Template']['id']; ?> </td>
<td align='center'><?php echo $templates['Template']['name']; ?> </td>
</tr>
<?php
}// end of foreach
}
else
{?>
<tr> <td>No Templates Found.</td></tr>
<?php
}?>
</table>