| Forum: snipeet |
|---|
| Topic: table prefix and phpName in schema.xml |
|---|
| table prefix and phpName in schema.xml [message #53529] |
Thu, 05 June 2008 13:25 |
simo Messages: 29 Registered: May 2008 Location: pondicherry |
Junior Member |
|
|
Hi all,
I wrote few lines of code to remove table prefix and automatically provides phpName attribute to tables on schema.xml file, respecting the CamelCase format.
You just have to provide the prefix, the source xml file and the generated xml file (if different - not compulsory).
<?php
$prefix = 'prefix_';
$filePath = 'way\to\your\xml\file';
$fileSave = 'way\to\the\generated\xml\file'; # not compulsory
function removePrefix ($string) {
$prefix = $GLOBALS['prefix'];
$string = str_replace($prefix, '', $string);
$arr = split('_', $string);
$name = '';
foreach($arr as $row) {
$name .= ucfirst($row);
}
return $name;
}
if (file_exists($filePath)) {
$xml =simplexml_load_file($filePath);
foreach($xml->xpath('//table') as $item) {
$attrs = $item->attributes();
$phpName = removePrefix ($attrs['name']);
$item->addAttribute('phpName', $phpName);
}
if(isset($fileSave) && $fileSave != '') {
$xmlFile = $fileSave;
} else {
$xmlFile = $filePath;
}
$xml->asXML($xmlFile);
} else {
exit('Failed to open file : '. $filePath);
}
?>
Hope i'm not re-inventing the wheel and it will be usefull to you!
I guess the message has to be switched to another category.. sorry for that.
[Updated on: Thu, 05 June 2008 13:30]
|
|
|
| Topic: click on "user" link in comment section throws 404 |
|---|
click on "user" link in comment section throws 404 [message #60751] |
Thu, 11 September 2008 11:48 |
kpprasad Messages: 1 Registered: August 2008 |
Junior Member |
|
|
scenario:
When user doesnt have any snippet associated with his user_id and if the user creates a comment and click on the user link available in the comment section it throws 404.
steps:
1. create a new user.
2. add comment to any snippet and now click on the user name in comment section.
[note: the new user should not have any snippet associated with his user_id.]
Let me know how to fix it.
Thanks in advance
KP
[Updated on: Thu, 11 September 2008 11:52]
|
|
|
| Forum: Documentation |
|---|
| Topic: Windows 'pake alltests' failure |
|---|
| Windows 'pake alltests' failure [message #499] |
Sun, 20 November 2005 04:55 |
spascoe Messages: 52 Registered: November 2005 Location: Indianapolis |
Member |
|
|
Hi again,
I'm continuing my quest to get the symfony tests to run under windows.
I've updated my copy of pake to use windows symlinks and have gotten past the building errors.
Now, I've got the following error:
C:\dev\symfony\lib>pake alltests
Test suite in (test)
Fatal error: Cannot redeclare class sfcache in C:\Documents and Settings\spascoe\Local Settings\Temp\tmpFB.tmp\42bd09cf0ffa3a3d5024c
a9f99c4eb21\lib\symfony\symfony\cache\sfCache.class.php on line 20
C:\dev\symfony\lib>
I've tracked this down as far as I can understand what's going on and now need some help:
The test that fails is sfLiveAppTest
It gets to line 74
require_once(SF_ROOT_DIR.'/'.SF_APP.'/config/config.php');
config.php gets down to line 46
require_once 'symfony/symfony.php';
I'm guessing that line 83 in symfony.php
require_once('symfony/cache/sfCache.class.php');
is reloading the sfCache.class.php file from a different place than it has already been loaded and that is cusing the error.
I've now reached the end of my knowledge and need the help of wiser beings 
Anyone have any insight into why this is happening?
Thanks,
Scott
|
|
|
| Topic: generating doc on linux |
|---|
| generating doc on linux [message #2894] |
Sat, 18 February 2006 05:36 |
spascoe Messages: 52 Registered: November 2005 Location: Indianapolis |
Member |
|
|
Hi all, expecially francoisz...
I've built a linux box to try to do some testing of documentation generation.
I've got a few questions about the symfony doc's and generation.
1. The convert2docbook.php file in svn doesn't seem to correctly conver the markdown text to docbook xml. Is this actually the one that is used to generate the doc on a nightly basis?
2. convert2docbook.php has a incorrect requires_once for spyc.php. Instead of looking in , it is looking in
3. convert2docbook.php also mentions a file which seems to be specific to the project, but isn't in the project.
(I'm really trying to figure out a solution to the pdf generation causing the progrma listing code that has long lines getting cut off problem.
Thanks for any insight,
Scott Pascoe
|
|
|
| Topic: New chapter added in the doc: Javascript Helpers |
|---|
New chapter added in the doc: Javascript Helpers [message #3950] |
Wed, 15 March 2006 13:48 |
francois Messages: 1593 Registered: October 2005 |
Faithful Member |
|
|
JavaScript helpers are already present in our tutorials (did you read the shopping cart tutorial and askeet day 8?), but the book didn't contain any detailed documentation about it yet. All those who had to dig into the source code to understand how the link_to_remote(), observe_field() or visual_effect() helpers work will probably be pleased to hear that a new chapter has just been added to the book.
The JavaScript helpers chapter will show you how to manage JavaScripts in your symfony templates, from the simple alert("foobar") to the more complex AJAX interactions.
http://www.symfony-project.com/content/book/page/javascript. html
Make sure you check it out before starting your new Web 2.0 application!
|
|
|
| Topic: file form validation |
|---|
|
| Topic: Wiki |
|---|
| Wiki [message #4493] |
Fri, 31 March 2006 05:37 |
|
|
Are there any wiki's in development based on symfony?
|
|
|
| Topic: Pretty-printed "My first symfony project" |
|---|
| Pretty-printed "My first symfony project" [message #5028] |
Sun, 16 April 2006 00:09 |
cprior Messages: 49 Registered: December 2005 Location: #symfony |
Member |
|
|
I am preparing a talk about symfony for the upcoming froscon.org and went on a test-drive with my preferred presentation-generator and symfony.
As an intermediate* result I have transformed the tutorial "My first symfony project" into a pretty-printed article version.
The .pdf file is available for download.
*) I need to be able to highlight symfony-methodnames and produce a handout version.
Update: Added index and glossary "code" behind the scenes.
[Updated on: Sun, 16 April 2006 15:41] --
Chris Prior
My docu-mirror
|
|
|
| Topic: searchable API? |
|---|
| searchable API? [message #6532] |
Tue, 23 May 2006 07:12 |
Styles722 Messages: 84 Registered: May 2006 Location: Miami, FL |
Member |
|
|
Is there are function reference somewhere that I have missed? I know there's the API docs but they are not searchable and it doesn't look like Google has them indexed... Can we make these searchable? I ran into this problem tonight - there were some methods that I was not aware of that are being used in the Snipeet application and I had no easy way to find out what they were...
Thanks,
Styles
|
|
|
| Topic: More Propel Code Snippets please :) |
|---|
|
| Topic: Persistent sessions with cookies page question. |
|---|
| Persistent sessions with cookies page question. [message #10255] |
Wed, 16 August 2006 19:07 |
akinas Messages: 69 Registered: April 2006 |
Member |
|
|
Correct me if I'm wrong.
On book page http://www.symfony-project.com/book/trunk/cookie
public function signIn($user, $remember = false)
{
$this->setAuthenticated(true);
if ($remember)
{
// determine a random key
if (!$user->getRememberKey())
{
$rememberKey = myTools::generate_random_key();
// save the key to the User table
$user->setRememberKey($rememberKey);
$user->save();
}
// save the key to the cookie
$value = base64_encode(serialize(array($user->getRememberKey(), $user->getLogin())));
sfContext::getInstance()->getResponse()->setCookie('MyWebSite', $value, time()+60*60*24*15, '/');
}
}
This part is problematic:
// determine a random key
if (!$user->getRememberKey())
The only way a user gets this far is by submitting a form which means his cookie does not exist or expired so the RememberKey needs to be generated again and set to cookie no matter what.
|
|
|
| Topic: AJAX tutorial is outdated |
|---|
|
| Topic: Minor fillin doc error |
|---|
| Minor fillin doc error [message #11383] |
Mon, 04 September 2006 11:25 |
halfer Messages: 6002 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
I believe this part, in the fillin docs, should use a double-space to indent the activate line. Could someone add the change, when they get a moment. Only a convention mistake but probably worth fixing for consistency. Thanks.
|
|
|
| Topic: Need to add getPresentationFor to docs |
|---|
| Need to add getPresentationFor to docs [message #11593] |
Wed, 06 September 2006 19:35 |
Draven Messages: 760 Registered: January 2006 |
Faithful Member |
|
|
For me atleast, this is a very usefull function but I couldn't remember the exact naming for the method or even what class it was that held it.
I found after 20 mins of endlessly searching the docs that it isn't even mentioned in there, anywhere. I think it would be usefull to add this in either the Actions or Templating sections so people know it exists.
Just a suggestion, it drove me nuts knowing it existed but not remembering where and how exactly to call it.
The only thing that finally lead me to remember what the calls name was a section under the sfView::VAR in the action docs stating...
The returned value can be read with $controller->getActionStock()->getFirstEntry()->getPresentation().
As you can see this isn't even the same as the getPresentationFor() method but it was enough to jog my memory.
|
|
|
| Topic: Filter docs? |
|---|
| Filter docs? [message #14574] |
Tue, 24 October 2006 22:20 |
halfer Messages: 6002 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Folks,
I know it has been mentioned a few times now in the fora, so I don't want point it out again too many times, but is there an ETA on docs for filters? I've mentioned filters a few times in my posts, but am somewhat stuck for official guidance on them (snippets and fora postings do help, though).
I could do with brushing up my knowledge in this area too, anyway
|
|
|
| Topic: Error in Templating in practice : Form helpers |
|---|
| Error in Templating in practice : Form helpers [message #17849] |
Wed, 13 December 2006 19:33 |
akinas Messages: 69 Registered: April 2006 |
Member |
|
|
| Quote: | # submit button (as text):
<?php echo submit_tag('Save') ?>
// will generate in HTML
<input type="submit" name="submit" value="Save" />
|
name="submit" should be name="commit".
|
|
|
| Topic: i18n tables and REDECLARED error |
|---|
| i18n tables and REDECLARED error [message #18100] |
Mon, 18 December 2006 16:17 |
|
I'd like to inform everybody that creating the schema.yml in the longest and detailed way, DONT WORK!
my_connection:
my_product:
_attributes: { phpName: Product, isI18N: true, i18nTable: my_product_i18n }
id: { type: integer, required: true, primaryKey: true, autoincrement: true }
price: { type: float }
my_product_i18n:
_attributes: { phpName: ProductI18n }
id: { type: integer, required: true, primaryKey: true, foreignTable: my_product, foreignReference: id }
culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
name: { type: varchar, size: 50 }
It produces lot of REDECLARED errors.
Use the fastest and shortest way only.
my_connection:
my_product:
_attributes: { phpName: Product}
id:
price: float
my_product_i18n:
_attributes: { phpName: ProductI18n }
name: varchar(50)
Happy symfony to all!
ps. Cannot insert comment on the relative page of the manual... it produce an error.
|
|
|
| Topic: model.txt reference to created_on, updated_on |
|---|
| model.txt reference to created_on, updated_on [message #18270] |
Wed, 20 December 2006 16:15 |
spascoe Messages: 52 Registered: November 2005 Location: Indianapolis |
Member |
|
|
Hi,
I was reading through the current trunk version of 'model.txt'
In the Column Magic section it discusses the naming conventions and mentions the following:
# 'created_at', 'updated_at', 'created_on', 'updated_on' columns: Timestamp
created_at: { type: timestamp }
Looking at the 'sfPropelDatabaseSchema.class.php' definition, I don't find any reference to 'created_on', or 'updated_on'.
I'm assuming that the mention in the documentation is incorrect.
If this is true, I will remove it upon confirmation from a developer (I've got edit access to the docs only).
Thanks, Scott Pascoe
|
|
|
| Topic: Validation docs amendment |
|---|
| Validation docs amendment [message #19909] |
Wed, 17 January 2007 15:58 |
halfer Messages: 6002 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
The validation docs state, in relation to the repopulation filter:
| Quote: | Note: This feature is only available with a symfony release higher than 1096 and is still considered Alpha, since the interface can change. Feel free to give your feedback about it.
|
Is this still the case for the trunk? I imagine this has probably settled down by now?
|
|
|
| Topic: Is Phing still necessary |
|---|
|
| Topic: congratulations on the new documentation |
|---|
| congratulations on the new documentation [message #20601] |
Tue, 30 January 2007 16:55 |
juwiley Messages: 19 Registered: November 2006 |
Junior Member |
|
|
Hi,
I just wanted to congratulate Francois and Fabien on the fantastic new documentation. I've only had the opportunity to skim through it, but from what I see so far: it looks great. I have a physical copy on order with Amazon as we speak, can't wait to get my hands on it.
Great work guys,
Justin
|
|
|
| Topic: mistake in TDGTS - encoding in databases.yml |
|---|
| mistake in TDGTS - encoding in databases.yml [message #20964] |
Sun, 04 February 2007 15:22 |
qube Messages: 79 Registered: August 2006 Location: Czech republic |
Member |
|
|
In online The Definitive Guide to symfony on this page:
http://www.symfony-project.com/book/trunk/08-Inside-the-Mode l-Layer
Presented default setting of databases.yml has incorrect value for encoding. 'utf-8' is not working on MySQL, working setting for utf is 'utf8' as follows:
encoding: utf8 # Default charset for table creation
Does this applies also to other databases?
btw, I can't add comment to that page, is it intended?
[Updated on: Sun, 04 February 2007 17:40]
|
|
|
| Topic: Typo On Pg 201 of Book? |
|---|
Typo On Pg 201 of Book? [message #21062] |
Mon, 05 February 2007 22:01 |
slarmore Messages: 31 Registered: January 2007 |
Member |
|
|
First, I am absolutely loving symfony. Tried Ruby on Rails, love symfony. It's every programming feature you begin to think about and then don't have the time to do (in certain work environments).
Second, I am really enjoying coursing through this book I just grabbed last weekend.
Ok, now to business.
The Definitive Guide Guide to symfony
Chapter 10: Forms
Page 201
Creating a Drop-Down List Based on a Foregin Key Column
Listing 10-13
Should '__toString()' be '__toString'?
Otherwise I think symfony is looking for 'yourAwesomeModel.__toString()()'.
Peace,
S
[Updated on: Mon, 05 February 2007 22:02] ------------------------------
Steve Larmore
slarmore aht chfund doht org
|
|
|
| Topic: Mistake ? OnlineBook Chapter 7, Declaring Helpers |
|---|
| Mistake ? OnlineBook Chapter 7, Declaring Helpers [message #22436] |
Sat, 24 February 2007 12:53 |
warzentiger Messages: 2 Registered: July 2006 Location: Austria |
Junior Member |
|
|
OnlineBook, Listing 7-3:
<?php echo use_helper('Text') ?>
I see the reason for echoing the returned values from helpers like FormHelper or ObjectHelper.
But what is returned from the HelperHelper that has to be echoed?
The 'use_helper' function uses 'sfLoader::loadHelpers' which doesn't return anything.
Is this a mistake?
btw: it's not possible to write comments anymore, intended ?
|
|
|
| Topic: Unable to comment on books? |
|---|
|
| Topic: SPAM contents in form,askeet tutorial. |
|---|
| SPAM contents in form,askeet tutorial. [message #22913] |
Sun, 04 March 2007 10:08 |
flyfront Messages: 2 Registered: March 2007 |
Junior Member |
|
|
Hello.
See the comment form of askeet day8.
http://www.symfony-project.com/askeet/8
I find SPAM contents in form.
What's happen?
Attachment: spam.png
(Size: 10.64KB, Downloaded 2325 time(s))
------------------------------------------------
flyfront
e-mail: flyfront@gmail.com
------------------------------------------------
|
|
|
| Topic: Big problem of understanding the implentation of MVC Pattern |
|---|
| Big problem of understanding the implentation of MVC Pattern [message #24482] |
Mon, 26 March 2007 23:31 |
hoschi Messages: 1 Registered: March 2007 |
Junior Member |
|
|
Hi,
I read the MVC chapter of the symfony book --> http://www.symfony-project.com/book/trunk/02-Exploring-Symfo ny-s-Code#The%20MVC%20Pattern
and don't understand why the symfony framework implents the MVC pattern as it does, because I miss this important Features of MVC:
- if the modell changes his data, it can force a validation of the connected views (the line between model and view in figure 2-2 isn't there)
- one controller can have more than one view
- view and modell don't now each other, they get connected through the controller --> in symfony the view call directly a action, this isn't MVC
Hasn't symfony this features? Do I haven't seen yet?
Please help 
|
|
|
| Topic: API.pdf file |
|---|
| API.pdf file [message #25200] |
Thu, 05 April 2007 12:42 |
Martyp Messages: 37 Registered: February 2007 Location: Prague, Czech Republic |
Member |
|
|
Hello,
I prefer to browse the API.pdf but I don't like these things:
- the classes in the bookmarks are not ordered alphabetically but by the API group, which is missing. I found it difficult to find the class I need so I have to use a search a lot
- the tags ' are not translated to ' and are shown as text. This is also on the API html pages. Can this be fixed?
- the page for the pdf file is sometimes too narrow so the text is cut at the right side of the page. Can it use a wider format?
Thanks for the API anyway, I just want to make it more readable.
|
|
|
| Topic: Filters: executing a filter exactly once per page request |
|---|
| Filters: executing a filter exactly once per page request [message #25270] |
Fri, 06 April 2007 08:34 |
strike Messages: 6 Registered: September 2006 Location: India |
Junior Member |
|
|
Hi,
Here I am referring to the filters which get executed before a page is served.
From documentation in Symfony book, chapter 6:
| Quote: |
The Front Controller's Job in Detail
.
.
7. Activate filters (for instance, if the request needs authentication).
8. Execute the filters, first pass.
9. Execute the action and render the view.
10. Execute the filters, second pass.
11. Output the response.
|
From documentation, it is clear that Filter chain makes multiple passes. In my case it is making 3 passes. I want my filter to get executed exactly once every page request. No matter how many passes fiter chain makes before it is rendered.
If I use code like this:
class myFilter extends sfFilter
{
public function execute($filterChain)
{
// Execute this filter only once
if ($this->isFirstCall())
{
//some code here
}
// Execute next filter
$filterChain->execute();
}
}
my filter gets executed 3 times as filter chain have to make 3 passes.
How can make sure that my filter gets executed exactly once, that too in first pass itself?
Additional info: I have two partials in my layout.
-Sam
|
|
|
| Topic: logo and styleguide for download |
|---|
| logo and styleguide for download [message #25990] |
Thu, 19 April 2007 12:52 |
redray Messages: 2 Registered: April 2007 |
Junior Member |
|
|
it would be really great if the symfony logo and eventually a styleguide would be releases like for typo3:
http://typo3.org/teams/design/style-guide/
|
|
|
| Topic: link_to_remote() bug |
|---|
| link_to_remote() bug [message #32061] |
Mon, 23 July 2007 20:38 |
kkragenbrink Messages: 3 Registered: July 2007 Location: Los Angeles, CA, USA |
Junior Member |
|
|
|
The API documentation suggests that you can set the position to top, bottom, before, or after to place the return content in various places relative to the id you want to update. After looking into how it's supposed to work, I've noticed that it changes this field to Insertion.<whatever>. Oddly, though, it's always using the same Insertion parameter, no matter what I change. Has anyone else noticed that top, after and before don't work? It's always bottom. I'd be really interested in getting this to work with 'before' and 'top' especially. Thanks.
|
|
|
| Topic: Started dutch translation of the book - any help is welcome |
|---|
| Started dutch translation of the book - any help is welcome [message #32720] |
Wed, 01 August 2007 22:53 |
skoop Messages: 20 Registered: November 2006 Location: The Netherlands |
Junior Member |
|
|
Hello everyone,
I just made a start with the dutch translation of the book: http://trac.symfony-project.com/trac/wiki/Documentation/nl_N L/book/1.0
If there are any other dutchies here that feel like helping me out, feel free to help. Preferably, to not work on the same things, start with a chapter that has yet to be translated. 
Stefan
Ibuildings - The PHP Professionals
|
|
|
| Topic: Bug: documentation error not fixed |
|---|
| Bug: documentation error not fixed [message #34094] |
Fri, 24 August 2007 10:12 |
halfer Messages: 6002 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
There's a bug I raised in the docs a couple of months ago, which has not been fixed:
http://trac.symfony-project.com/trac/ticket/1923
|
|
|
| Topic: askeet, day six documentation |
|---|
| askeet, day six documentation [message #36081] |
Fri, 21 September 2007 14:58 |
agonirena Messages: 2 Registered: September 2007 Location: Elgoibar, Gipuzkoa, Spain |
Junior Member |
|
|
I am following the askeet tutorial.
After reading day six documentation, I think there is a little error.
The paragraph below "How about a bit of refactoring?" header, is talking about myUser class. This class behaviour is a sort of magic without explaining the role it plays in session management. What about extending a bit about the myUser class?
Talking about myUser class, the same paragraph contains this sentence: the session class, not the User class corresponding to the User column. I think that 'column' should be changed by 'table'.
sorry for my bad english
|
|
|
| Topic: askeet, day eight, documentation |
|---|
| askeet, day eight, documentation [message #36298] |
Wed, 26 September 2007 00:41 |
agonirena Messages: 2 Registered: September 2007 Location: Elgoibar, Gipuzkoa, Spain |
Junior Member |
|
|
|
The interest box is called from question/_list.php fragmnet and question/show template. Day 8 documentation remembers to add id="block_<?php echo $question->getId() to _list.php fragment but forgets to do the same with the showSuccess.php template.
[Updated on: Wed, 26 September 2007 00:42]
|
|
|
| Topic: How do I show post titles related to "My First Project" tutorial? |
|---|
| How do I show post titles related to "My First Project" tutorial? [message #39583] |
Thu, 15 November 2007 17:06 |
foobar Messages: 5 Registered: June 2006 |
Junior Member |
|
|
In the tutorial the following code is shown:
<?php if ($sf_params->has('post_id')): ?>
<?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?>
<?php else: ?>
<tr>
<th>Post*:</th>
<td><?php echo object_select_tag($comment, 'getPostId', array('related_class' => 'Post')) ?></td>
</tr>
<?php endif; ?>
How can I change this, that the title of the post is also shown? How do I get this result:
<td><select name="post_id" id="post_id"><option value="" selected="selected"></option>
<option value="1">Great first Post</option>
<option value="2">Second post</option>
</select></td>
[Updated on: Thu, 15 November 2007 17:07]
|
|
|
| Topic: How to handle multiple schemas |
|---|
How to handle multiple schemas [message #39972] |
Tue, 20 November 2007 23:20 |
jhleoh Messages: 1 Registered: November 2007 |
Junior Member |
|
|
I'm trying to create two schema in oracle, using two different user id (core, reference).
In my databases.yml file, I defined two connections one for each user id.
Then I created two *schema.yml files, one for each connection.
I expect the propel will generate two sql files for me, one for each user id.
But I found the actual output sql file only contains tables in the first schema file.
In order to create all tables, I must use same connection in both schema files.
In the documentation, it says multiple schema is supported, is there something wrong with my setting?
Below is a sample of my files:
databases.yml
all:
reference:
class: sfPropelDatabase
param:
phptype: oracle # Database vendor
hostspec: localhost
database: mydb
username: reference
password: password
port: 1521
encoding: utf8 # Default charset for table creation
persistent: true # Use persistent connections
core:
class: sfPropelDatabase
param:
phptype: oracle # Database vendor
hostspec: localhost
database: mydb
username: core
password: password
port: 1521
encoding: utf8 # Default charset for table creation
persistent: true # Use persistent connections
core-schema.yml
core:
person:
id: { type: integer, required: true,primaryKey: true, autoIncrement: true }
first_name: { type: varchar(50), required: true, index: true }
middle_name: { type: varchar(50), required: true}
last_name: { type: varchar(50), required: true, index: true }
gender: integer
nick_name: { type: varchar(50), required: true, index: true }
date_of_birth: bu_date
created_on: date
updated_on: date
reference-schema.yml
reference:
type:
id: { type: integer, required: true,primaryKey: true }
type_name: varchar(50)
[Updated on: Tue, 20 November 2007 23:23]
|
|
|
| Topic: Unit Testing Tutorial with Explanation on how to use it with Database |
|---|
| Unit Testing Tutorial with Explanation on how to use it with Database [message #39974] |
Wed, 21 November 2007 00:48 |
DrDrakken Messages: 80 Registered: January 2007 |
Member |
|
|
|
I think it would be great if there could be a tutorial that could walk us through the unit and functional testing process. More specifically with emphasis on how to use Doctrine with unit testing. Ch 15 in the book does not really go into the testing in much detail and leaves beginners completely lost with regards on how to unit test functions that use the Doctrine database objects
|
|
|
| Topic: right step for building a new application? |
|---|
| right step for building a new application? [message #40649] |
Fri, 30 November 2007 10:30 |
Onir Messages: 80 Registered: December 2006 Location: Italy |
Member |
|
|
Hallo,
I have some difficult to understand well the meaning of every function to create an application.
help me to create a little tutorial for creating a new application with simfony.
Steps:
1)create directory for new application (es. MyApp)
2)at the root of MyApp:
symfony init-project NameApplication
(to create directory structure)
mydify ../config/propel.ini (for giving to symfony db password ecc...)
3)create db structure and create schema.yml
3a) create db structure with DBDesigner (http://fabforce.net/dbdesigner4/)
3b)transform the file created with DBDesigner in schema.xml using
http://blog.tooleshed.com/docs/dbd2propel/transform.php
YOU Don't need to create schema.yml (See post http://www.symfony-project.org/forum/index.php?t=rview&t h=10051)
is not userfull-> 3c)delete schema.yml and copy schema.xml created at point 3b
is not userfull-> 3d) create schema.yml running symfony propel-build-schema
NOW symfony have the schema of application
so you can build the model
4) symfony propel-build-model
for building model
5)
symfony propel-build-sql
for building sql
symfony propel-insert-sql
for creating tables in databases
Now Database contains what model represent
6)create crud module or application module
is right?
in these steps I don't understand well the difference beetween:
name of Application name of project in propel.ini, name in database.yml (usually propel)...
I thimk that in symfony documentation miss a good explanation of meaning of steps for creating application.
Thank you in advance
[Updated on: Fri, 30 November 2007 10:41]
|
|
|
| Topic: sfFileValidator |
|---|
| sfFileValidator [message #43633] |
Thu, 17 January 2008 23:13 |
ouillonn Messages: 27 Registered: July 2007 |
Junior Member |
|
|
Hi everybody,
I think it may be usefull to write down in the documentation of sfFileValidator that the order of the mime-types is actually VERY important, especially for the Internet Explorer.
I had an interesting experience with that little trap. I added the mime "image/gif" in the middle of the list like that:
sfFileValidator:
mime_types:
- 'image/jpeg'
- 'image/png'
- 'image/gif'
- 'image/x-png'
- 'image/pjpeg'
and the IE didnt get it and threw the mime-error-message. But if I change the order to
sfFileValidator:
mime_types:
- 'image/jpeg'
- 'image/png'
- 'image/x-png'
- 'image/pjpeg'
- 'image/gif'
everything works fine.
Maybe this is a stupid request, maybe I'm blind. But actually, its quiet amberrant! So I hope this will help some people out there!
Greets from Berlin
|
|
|