archive-com.com » COM » S » SOLARPHP.COM

Total: 875

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Solar Framework for PHP 5
    example we use the vim editor but you can use anything you like vim Blog php Add the following PHP code to the class php public function actionDrafts draft blog articles in ascending order all result pages fetch array where array blogs status draft order blogs created ASC page all fetch all matching records this list this model blogs fetchAll fetch 1 10 2 The Drafts View Script Create a view called drafts php for the actionDrafts method vim Blog View drafts php Enter the following code in the new drafts php view script php title this getTextRaw TITLE DRAFTS this head setTitle title h2 php echo this getText HEADING DRAFTS h2 php if this list p php echo this getText ERR NO RECORDS p php else ul php foreach this list as item li php echo this escape item title echo nbsp nbsp echo this action this controller edit item id ACTION EDIT li php endforeach ul php endif p php echo this action this controller add ACTION ADD p This view shows a list of draft articles stored in this list along with a link to edit each one At the bottom of the page is a link

    Original URL path: http://solarphp.com/manual/blog-demo.app.drafts (2016-02-13)
    Open archived version from archive


  • Solar Framework for PHP 5
    this item save get form hints from the record this form this item newForm turn off http caching this response setNoCache Controller Action and Process We already know about controller classes and action methods However an action method may handle different processes based on which submit button was clicked in a form The submit button pressed is called the process being requested of the action the value is passed by default as POST process Some explanation of what s going on in this method First we attempt fetch the requested blog article by its ID if it doesn t exist we show an error Next we look to see if the user has clicked the save button by checking isProcess If so we load the data from POST blog into our record and attempt to save it Finally we get a set of form hints from the record and retain them in this form If the save failed the form hints will have a series of feedback messages to tell us what went wrong 1 11 2 The Edit View Script Create a view called edit php for the actionEdit method vim Blog View edit php Enter the following code in the new edit php view script php title this getTextRaw TITLE EDIT this head setTitle title h2 php echo this getText HEADING EDIT h2 php echo this form auto this form addProcess save fetch Essentially this view takes the form hints this form and auto generates a form for the user to work with Where s the Form Code The form helper for Solar views takes the form hints stored in this form and auto generates a form for you These hints came from the record object for example the select pulldown is pre populated with draft and public

    Original URL path: http://solarphp.com/manual/blog-demo.app.edit (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    request and load into the record data this request post blog this item load data attempt to save it and redirect to editing on success if this item save uri this controller edit this item id return this redirectNoCache uri get form hints from the record this form this item newForm turn off http caching this response setNoCache This action is very similar to the actionEdit method but here we don t attempt to fetch an existing record Instead we fetch a new default record to work with The process check and save are similar as well but on a successful save we redirect to the edit action for further editing of the newly saved article Redirect Solar page controllers have two methods for redirecting a web request redirect and redirectNoCache The no cache version makes it so that clicking the back button does not result in a accidental resubmission 1 12 2 The Add View Script Create a view called add php for the actionAdd method vim Blog View add php Enter the following code in the new add php view script php title this getTextRaw TITLE ADD this head setTitle title h2 php echo this getText HEADING ADD

    Original URL path: http://solarphp.com/manual/blog-demo.app.add (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    default a Solar page controller will use a view named for the action However you can tell it to use a different view by changing the value of this view Some explanation of what s going on in this method We attempt fetch the requested blog article by its ID if it doesn t exist we show an error Then we look to see if the user has clicked the delete button by checking isProcess If so we delete the record and switch to the deleteSuccess view instead of the default delete view That s all there is to it 1 13 2 The Delete View Scripts This action has two views that it uses one for displaying the Are you sure page the default and one for displaying the Successfully deleted the record page First create a view called delete php vim Blog View delete php and enter the following code in the new delete php view script php title this getTextRaw TITLE DELETE this head setTitle title h2 php echo this getText HEADING DELETE h2 h3 php echo this escape this item title h3 php echo this nl2p this item body php echo this form addProcess delete fetch

    Original URL path: http://solarphp.com/manual/blog-demo.app.delete (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    php The locale file is loaded on demand Every class in Solar has a locale method that translates a locale key to its replacement string As with most other things in Solar locale files are inherited so if you ask for a locale key that exists only in a parent class Solar will work up the inheritance chain until it finds that key Inside a view you can use the getText helper to get the locale strings for the application You can use the locale method on other objects in the view to get their translation strings 1 14 2 Modify Locale File To modify the locale strings for the blog application open the Blog Locale en US php file vim Blog Locale en US php Change the contents of the file to the following and save it php return array ERR NO ID SPECIFIED No ID was specified ERR NO RECORDS No records found ERR NO SUCH ITEM That item does not exist HEADING ADD Add New Article HEADING DELETE Delete This Article HEADING DRAFTS Draft Articles HEADING EDIT Edit Article HEADING INDEX Published Articles TEXT DELETED Deleted the article TITLE ADD Blog Add New Article TITLE DELETE Blog

    Original URL path: http://solarphp.com/manual/blog-demo.locale (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    ServerName subdomain example com DocumentRoot SYSTEM docroot VirtualHost The standard Solar system docroot directory already contains a htaccess file that turns on mod rewrite The rules therein look something like this IfModule rewrite module turn on rewriting RewriteEngine On hint the Solar Uri Action class as to the base path SetEnv SOLAR URI ACTION PATH turn empty requests into requests for index html keeping the query string intact RewriteRule index html QSA for all files not found in the file system reroute to index php bootstrap script keeping the query string intact RewriteCond REQUEST FILENAME d RewriteCond REQUEST FILENAME f RewriteRule index php QSA L IfModule Note You may need to set AllowOverride All in the Directory section of your Apache configuration file for the SYSTEM directory After you restart Apache or otherwise refresh the service with the new configuration you should be able to browse to the same app using the new virtual host without an index php in the URI For example whereas previously we used http localhost index php blog you should now be able to go to http subdomain example com blog Faking A Domain You can fake a domain by adding an entry to your

    Original URL path: http://solarphp.com/manual/blog-demo.vhost (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    The Model Catalog 3 4 Fetching Data 3 5 Records and Collections 3 6 Record Creation Modification and Saving 3 7 Record Filters 3 8 Special Column Processing 3 9 Single Table Inheritance 4 Working With Related Models 4 1 Introduction 4 2 Domain Description 4 3 Native Model Has One Related Foreign Record 4 4 Native Model Has Many Related Foreign Records 4 5 Native Model Belongs To Related Foreign Model 4 6 Native Model Has Many Related Foreign Records Through An Association 4 7 Eager Fetching 4 8 Creating Modifying and Saving Relateds 5 Views and Layouts 5 1 Introduction 5 2 Location of Views and Layouts 5 3 Nested Views and Partials 5 4 Alternate Formats 5 5 View Helpers 5 6 Layouts 6 Models and Forms 6 1 Introduction 6 2 Controller Logic 6 3 The Form Object 6 4 Form Elements 6 5 View Presentation 6 6 View Decoration 6 7 Semi Automatic View Presentation 6 8 Custom Record Elements 6 9 Locale Strings 7 User Authentication Roles and Access Control 7 1 Introduction 7 2 The Solar User Object 7 3 Authentication Processing 7 4 Authentication Forms 7 5 Roles 7 6 Access Control 7 7 Integration With Page Controllers 7 8 Ownership Access 8 Command Line Tools 8 1 Introduction 8 2 Make Vendor Source 8 3 Link Vendor Source 8 4 Link Public Assets 8 5 Unlink Vendor Source 8 6 Get Help 8 7 Make One Or More Models 8 8 Make A Web Application Page 8 9 Make A CLI Command 8 10 Make A Test Suite 8 11 Run A Test Suite 8 12 Make Wiki Like Documentation 8 13 Make DocBook Files 9 Mail 9 1 Introduction 9 2 Composing Messages 9 3 Message Attachments 9 4 Sending

    Original URL path: http://solarphp.com/manual/index (2016-02-13)
    Open archived version from archive

  • Solar Framework : About
    conventions and exhibits strong conceptual integrity Thorough integration of enterprise development patterns such as Dependency Injection and Service Locator Lazy Load Model View Controller Front Controller Page Controller Table Data Gateway Data Mapper Metadata Mapping Foreign Key Mapping Association Table Mapping Template View Two Step View Query Object Registry Server Session State Full name spacing Solar classes have their own PHP 5 2 name space and vendors developing to Solar standards also use their own name space This makes it easy to mix and match components from other libraries and frameworks Inheritable configuration by class Set a value in the config file for one class and all its children inherit those values by default Inheritable localization by class Set the locale strings for a class and all its children inherit those strings Easy to use defense in depth against SQL injection cross site scripting cross site request forgery and other common exploits Robust and powerful model system that lets you create forms automatically from record objects Sane and extensible data filtering to validate and sanitize user input Authentication adapters for LDAP TypeKey database htpasswd and other sources Cache adapters for memcache APC XCache and other systems View helpers for links

    Original URL path: http://solarphp.com/project/ (2016-02-13)
    Open archived version from archive



  •