|
Main (PHP)
3rd Party Streams
Resources
Code Snippets
Affiliates
|
|
|
| |
|
| By admin ( 2007-10-11
1535 views.
)
|
| A common attack on web sites is to plug in HTML code directly into a form field and attempt to gain control over some part of the site. |
| |
|
| |
|
| By admin ( 2007-10-11
1237 views.
)
|
| PHP has a built-in function to encrypt a string, crypt(clear, salt) that would allow for an easy mechanism for encrypting strings, such as passwords for applications. |
| |
|
| |
|
| By admin ( 2007-10-11
1201 views.
)
|
| PHP has two built-in functions that enable easy generation of a checksum: md5() and sha1(). |
| |
|
| |
|
| By admin ( 2006-12-26
2639 views.
)
|
I find that when developing I would normally use some other tool, such as phpmyadmin, to modify the structure of an existing database that I am using in a Symfony project.
These are the steps to update the Symfony data model code generated from an acompanying MySql database. I find I have to run these steps often while developing the application.
Assuming you are shelled into the root of your application directory. Also assumes that propel.ini points to your database.
1) We generate the schema using step 1.
This will generate the schema.yml file in your app/config directory.
2) While YML is nice, we really need XML so, we use this step 2command.
Again, this is quite verbose and not really human readable.
3) Finally, generate the code we use in base and peer classes using step 3.
The actual database access layer code is generated in the app/lib/model directory with names like Tablename.php and TablenamePeer.php. You normally use these objects for all database access.
This also generates all the BaseTablename.php and BaseTablenamePeer.php files in your app/lib/model/om directory. These are used as base classes in the previous code set.
This the first of a series of shorts on developing in Symfony |
| |
|
| |
|
| By admin ( 2006-12-26
2526 views.
)
|
I have slid by avoiding using field formatting in Smarty templates for some time. However, I just ran across a case where a dollar value HAD to be formatted correctly for display.
It turns out it is pretty easy to use formatting. In the actual template you have code that looks like the template code below. We have a field called bid that is being formatted according to the number_format function.
In the smarty/libs/plugins directory we create the file modifier_number_format.php. This tells smarty (when it loads) to pull in the modifier (formatting) function as defined in the file. That way our template can address it at will.
As you recall, all we are doing is calling the php number_format function with a bunch of arguments. It helps to remember that Smarty really is a bunch of PHP code under the covers.
So, in the specific case we are formatting a number ($number), with 2 decimals (2), a decimal point (".") and a thousands separator (",").
Using this as a model you can move on to some really interesting formatting using all kinds of PHP tools at you disposal. |
| |
|
| |
|
|
| Item(s) 1 to 5 of 56.  Go to page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 |
| |
|
|
|
Top Sponsor
Sponsors
Sponsors
Advertisting
Affiliates
|
|