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
    methods together in a single call to perform a series of operations in sequence The easiest way to display a form is to use this form auto This method will take a Solar Form object and build out its elements automatically for us We have seen this previously in the blog demo for edit php view php echo this form fluent form helper auto this form auto build from a Solar Form object addProcess save add a Save button fetch fetch the xhtml output Note What s with the call to addProcess The model record newForm method does not add submit buttons since it doesn t necessarily know how the form is going to be used by the calling logic As such we add submit buttons with process keys at view time the process keys allow the controller to know which submit button was clicked by the the end user Those four lines of view script code build the form for you complete with CSS classes and IDs based on the form element types names attributes whether or not they are required whether or not they are invalid and so on form action blog edit 2 method post enctype multipart form data dl class list dt class blog status label for blog status class blog status Status label dt dd class blog status select name blog status id blog status class input select blog status option value draft label draft selected selected draft option option value public label public public option select dd dt class blog title require label for blog title class blog title require Title label dt dd class blog title require input type text name blog title value A Draft Article maxlength 63 size 60 id blog title class input text blog title require dd dt class

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


  • Solar Framework for PHP 5
    tags The decorateAsDivs method puts all the elements in nested div tags The list as a whole is wrapped in a div tag and each label value pair is wrapped in another div tag Finally the decorateAsPlain removes all structural decoration tags All you need to do is call the right decorator method and the form helper will do the rest Below is the same code as in the blog demo edit php view with one extra decorator call added php echo this form auto this form addProcess save decorateAsDivs use div s instead of dl tags fetch The resulting output looks like this form action blog edit 1 method post enctype multipart form data div class list div class blog status label for blog status class blog status Status label select name blog status id blog status class input select blog status option value draft label draft draft option option value public label public selected selected public option select div div class blog title require label for blog title class blog title require Title label input type text name blog title value Public Blog Entry maxlength 63 size 60 id blog title class input text blog title require div

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

  • Solar Framework for PHP 5
    endFieldset methods add opening and closing fieldset tags respectively The addElements method adds only the elements listed The complementary Solar Form getElements method retrieves elements from the form object If you pass a string argument it will return all elements whose name begins with that string if you pass an array of element names it will return only those elements The output generated by that view script code will look something like the following form method post enctype multipart form data fieldset legend LEGEND NAME legend dl class list dt class user name first label for user name first class user name first LABEL NAME FIRST label dt dd class user name first input type text name user name first value id user name first class input text user name first dd dt class user name middle label for user name middle class user name middle LABEL NAME MIDDLE label dt dd class user name middle input type text name user name middle value id user name middle class input text user name middle dd dt class user name last label for user name last class user name last LABEL NAME LAST label dt dd class user name last input type text name user name last value id user name last class input text user name last dd dl fieldset fieldset legend LEGEND CONTACT legend dl class list dt class user email label for user email class user email Email label dt dd class user email input type text name user email value id user email class input text user email dd dt class user phone label for user phone class user phone LABEL PHONE label dt dd class user phone input type text name user phone value id user phone class input text user phone dd dl fieldset dl

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

  • Solar Framework for PHP 5
    the newForm method which record properties you want in the form For example let s have our page controller action method only get a form of the record s name properties php var Acme Model Users Record this item A record object this form this item newForm array name first name middle name last We can also override the form element descriptors For example let s limit the name middle element to 3 characters wide in the form php var Acme Model Users Record this item A record object this form this item newForm array name first name middle array attribs array size 3 name last However instead of doing that in the controller logic it s usually better to override the newForm method and modify the form object before returning it That way any logic that needs a form object can use the record method instead of re customizing the form every time We can also create extra methods on the record object for the specific kinds of forms we need These methods can themselves use newForm internally to do most of the heavy lifting For example php class Acme Model Users Record public function newFormOfNames form this newForm

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

  • Solar Framework for PHP 5
    come from the controller locale file This is because you are no longer operating inside the model record you are in a view being generated by the controller 6 9 3 Invalid Strings When a record has an invalid property its invalidation message normally comes from the the filter locale file If a validation filter ValidateAlpha on a property column name fails then the translation key will be INVALID VALIDATE

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

  • Solar Framework for PHP 5
    5 Usage 7 4 Authentication Forms 7 5 Roles 7 5 1 Adapters 7 5 2 Configuration 7 5 3 Usage 7 6 Access Control 7 6 1 Adapters 7 6 2 Configuration 7 6 3 List Format 7 6 4 Usage 7 7 Integration With Page Controllers 7 7 1 Catch All Access Control 7 7 2 Intra Action Access Control 7 8 Ownership Access 7 8 1 Preparing

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

  • Solar Framework for PHP 5
    login or sign in process or alternatively noting that the user is unidentified or anonymous User roles the groups or roles that user plays within the system User access what parts of the system the user is allowed to work with based on his identity and or roles within the system In Solar each of those aspects is represented by a separate set of adapter based classes Solar Auth provides adapters that allow users to authenticate against various identity storage backends SQL tables LDAP servers email servers etc The authentication system is completely automated and does not require a controller to activate or maintain it Solar Role provides adapters that given a username i e a user s handle will find out the groups i e roles to which a user belongs The adapters include file based and SQL table based storage backends Solar Access provides adapters that look up what controllers and actions a user is allowed to access based on that user s handle and roles Access control backends include files and SQL tables Because all three of those aspects are related to each other Solar provides a Solar User class to compose an instance of each adapter

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

  • Solar Framework for PHP 5
    Access Adapter instances As such we should start by keeping a Solar User object in the registry so that we have the same user information available across the whole system In the config file we tell Solar to automatically register a Solar User object called user like so php SYSTEM config php config Solar registry set user Solar User return config Now we can retrieve the registered user object from anywhere in the Solar system php user Solar Registry get user At contruction time Solar User automatically creates an instance of each of the following adapters using their respective configuration values from the config file under each of the following properties user auth a Solar Auth Adapter instance user role a Solar Role Adapter instance user access a Solar Access Adapter instance This means you don t need to create for example an instance of Solar Auth yourself Instead you get the registered Solar User object and address its auth property What About Configuration If Solar User creates the adapter instances automatically how can we configure those instances Because Solar uses a unified constructor unified configuration and a unified adapter mechanism the instances will automatically pick up their configuration from

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



  •