For the table users, I have written like
yiic shell
model users (it works)
crud users
The last line does not finish
>> crud users
unchanged UseersController.php
unchanged UsersTest.php
unchanged create.php
unchanged update.php
unchanged index.php
unchanged view.php
...then it hangs
So when I go to qdr/index.php?r=words/create
it shows some error like
WordsController cannot find the requested view "_form".
C:\xampp\htdocs\qdr\framework\web\CController.php(878)
The result is supposed to be like-
>> crud User
generate UserController.php
generate UserTest.php
mkdir D:/testdrive/protected/views/user
generate create.php
generate update.php
generate index.php
generate view.php
generate admin.php
generate _form.php
generate _view.php
so the _form.php, _view.php etc is not created.
Why is this? Please give me a solution.
its deprecated use gii instead. referring you a video: http://www.youtube.com/watch?v=9lyg9qIH7oQ
Please Watch and use.
Thanks
Related
I am using jmeter in elemetery freya (14.04)
I have a jmeter test plan with view results tree
I am trying to generate a csv file in view results tree including the number of active threads field.
It appears to me that the detail is being entered in the result.csv file, but the values representing this attribute has no field name, and hence that detail cannot be used in a graph which I want to create from the result.csv
I have changed JMETER-INSTALL-DIR/bin/jmeter.properties according to https://jmeter-plugins.org/wiki/PluginInstall/#Configure-JMeter
How can I get a result.csv file with a suitable fieldname like "active-threads"
Don't change anything in jmeter.properties file, upgrade to new JMeter version will discard your changes. Use user.properties file instead
The in order to add column names to CSV file add the following property to user.properties file:
jmeter.save.saveservice.print_field_names=true
Assuming good configuration you should be seeing grpThreads and allThreads columns along with the values.
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of working with them
Lets say i have a scenario in feature file like below
Given I log in as "super" user
When I click on login
Then Home page is displayed
With corresponding step definitions:
[Given(#"I log in as ""(.*)"" user")]
public void GivenIHaveLogInAsUser(string p0)
{
ScenarioContext.Current.Pending();
}
Now I want to change
Given I log in as "super" user
To
Given I have logged in as "super" user
When I make this change in feature file how to get SpecFlow to make this change automatically in the step definition.
UPDATE
This feature was added in a fairly recent update, so you should be able to follow the instructions here, which basically say
You can globally rename steps and update the associated bindings automatically. To do so:
Open the feature file containing the step.
Right-click on the step you want to rename and select Rename from the context menu.
Enter the new text for the step in the dialog and confirm with OK.
Your bindings and all feature files containing the step are updated.
Note: If the rename function is not affecting your feature files, you may need to restart Visual Studio to flush the cache.
previous answer
This is not possible I don't believe. you have 2 options:
amend the step definition text to match the new text
add the new definition to the step as well
like so:
[Given(#"I log in as ""(.*)"" user")]
[Given(#"I have logged in as ""(.*)"" user")]
public void GivenIHaveLogInAsUser(string p0)
{
ScenarioContext.Current.Pending();
}
This will allow steps with both pieces of text to match
Bit late to this thread, but you may use visual studios find and replace tool with regex enabled to replace both the step definition and the step implementations together.
e.g for the step definition: Given I have a message '(.*)' that is (.*) characters long, we can use the step definition itself to use in search for any matching steps, and replace with the new step. $n can be used to carry over regex matches picked up in the find.
Find: I have a message '(.*)' that is (.*) characters long
Replace: I have a message $1 that is $2 characters in length
Result: 'I have a message 'myMessage' that is 100 characters long' becomes 'I have a message 'myMessage' that is 100 characters in length'
How can I create a new blank page in zen-cart without applying the template.
I want to create a page that will result only a JSON data...
Thanks in advance
Create a php file in your store directory. In that file, if you want to use ZenCart functions you can include them, like so:
<?php
include "includes/application_top.php";
set headers for mime type
set headers for not caching
YOUR CODE
echo $json;
// below is optional if you didn't create/edit session
include "includes/application_bottom.php";
I am trying to create CRUD for my model classed generated automatically by GII.
Classes are stored like models/entity/Article.php. When i try to Gii generator put as class name models.entity.SomeClass or entity.SomeClass it doesn`t work.
The gii stops with exception Alias "entity.Article" is invalid. Make sure it points to an existing directory or file.
How can I run CRUD script properly?
Set the alias in your config/main.php file (do this before the return array):
Yii::setPathOfAlias('entity',dirname(__FILE__).DIRECTORY_SEPARATOR.'../models/entity');
// rest of config
return array(
// ...
);
Then use entity.Article in gii.
I want to cache the database content in yii and used that data in Yii drop down list. In the dropdownlist want to load the country names from database. (Have 2 tables user and country). In user form need the drop down list. That selected from country table using cache. Where queries are placed and when we can use the cache result in the user form?
In order to cache the results from a table and then use that in a dropdown you'll need to first set up caching in your config file as described in the Caching Overview of the Definitive Guide. If you wanted to use memCache you could set it up like so;
array(
......
'components'=>array(
......
'cache'=>array(
'class'=>'system.caching.CMemCache',
),
),
);
Yii can use a number of difference caches which are listed in the Caching Overview link above.
You'll then need to make use of Yii's data caching features. You can just do this in your user/_form.php view, for example;
...
echo $form->dropDownList($model,'country_id',CHtml::listData(Country::model()->cache(1000)->findAll(),'id','name'));
...
But the more MVC way would be to do this in your controller, something like so would work;
In your UserController:
...
public function actionUpdate()
{
...
$this->render('update',array(
'model'=>$model,
'countryList=>Country::model()->cache(1000)->findAll();,
);
}
...
In your user/update.php view:
...
echo $this->renderPartial('_form', array('model'=>$model,'countryList'=>$countryList));
...
In your user/_form.php view:
...
echo $form->dropDownList($model,'country_id',CHtml::listData($countryList,'id','name'));
...
The examples above use no dependency for the cache, so the cached values will stay valid until the time (in this case 1000 seconds) expires.
To read more about using a cache dependency, you can read the Cache Dependency section of the Data Caching doc.
[EDIT]
If you need to install memcached, and are using xampp on Windows, this is a great guide to get it working: HOW TO INSTALL MEMCACHED ON XAMPP ON WINDOWS 7