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
    and set up a virtual host to point to the SYSTEM docroot directory Change to the SYSTEM directory You should see a file listing like this cd SYSTEM ls 1F README config config php docroot include index php script source sqlite tmp Change the permissions on the tmp and sqlite directories so that they are writable by the web server chmod R 777 sqlite tmp Warning Note that opening worldwide

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


  • Solar Framework for PHP 5
    Controller Command Info Creating SYSTEM source acme Acme Controller Command Locale Creating SYSTEM source acme Acme Controller Page Layout Creating SYSTEM source acme Acme Controller Page Locale Creating SYSTEM source acme Acme Controller Page Public Creating SYSTEM source acme Acme Controller Page View Creating SYSTEM source acme Acme Model Writing SYSTEM source acme Acme Cli Help php done Writing SYSTEM source acme Acme Cli Help Info options php done Writing SYSTEM source acme Acme Controller Bread php done Writing SYSTEM source acme Acme Controller Bread Locale en US php done Writing SYSTEM source acme Acme Controller Bread View item php done Writing SYSTEM source acme Acme Controller Bread View list php done Writing SYSTEM source acme Acme Controller Bread View add php done Writing SYSTEM source acme Acme Controller Bread View browse php done Writing SYSTEM source acme Acme Controller Bread View delete php done Writing SYSTEM source acme Acme Controller Bread View edit php done Writing SYSTEM source acme Acme Controller Bread View read php done Writing SYSTEM source acme Acme Controller Bread View search php done Writing SYSTEM source acme Acme Controller Command php done Writing SYSTEM source acme Acme Controller Page php done Writing SYSTEM source acme Acme Filter php done Making directory SYSTEM source acme Acme Sql done Writing SYSTEM source acme Acme Sql Model php done Making directory SYSTEM source acme Acme Sql Model done Writing SYSTEM source acme Acme Sql Model Collection php done Writing SYSTEM source acme Acme Sql Model Metadata php done Writing SYSTEM source acme Acme Sql Model Record php done Writing SYSTEM source acme config default php done Writing SYSTEM source acme config run tests php done Writing SYSTEM source acme Acme Cli Help Info help txt done Making links for vendor Acme Making link include Acme done Making link

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

  • Solar Framework for PHP 5
    catalog and tell it what your application class prefixes will be php model catalog config Solar Sql Model Catalog classes array Acme Model Add new config keys to tell Solar what SQL adapter to use and to configure that adapter For SQLite use the following php the SQL adapter class to use config Solar Sql adapter Solar Sql Adapter Sqlite configure the SQL adapter class config Solar Sql Adapter Sqlite array name system sqlite acme sq3 the database file to use Note The system variable is defined at the top of the SYSTEM config php file and is the same as the SYSTEM directory For MySQL use the following php the SQL adapter class to use config Solar Sql adapter Solar Sql Adapter Mysql configure the SQL adapter class config Solar Sql Adapter Mysql array host localhost the database server host name database the database name user username authenticate as this user pass password authenticate with this password Note For PostgreSQL substitute Solar Sql Adapter Pgsql for the adapter class name and the config key By the end of this process the end of your config file should look something like this php project overrides front controller config Solar Controller

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

  • Solar Framework for PHP 5
    SQLite database make sure to chmod it so that the web server has read and write privileges Now that we have a table let s add some indexes and bare bones data to it so we have something to look at later INSERT INTO blogs created updated status title body VALUES 2010 01 01 00 00 00 2010 01 01 00 00 00 public Public Blog Entry First post INSERT INTO blogs created updated status title body VALUES 2010 01 01 06 00 00 2010 01 01 06 00 00 draft A Draft Article My it sure is drafty in here INSERT INTO blogs created updated status title body VALUES 2010 01 01 12 00 00 2010 01 01 12 00 00 draft Please delete me This is here to be deleted At the command line in the SYSTEM directory issue the make model command You will see something like the following script solar make model Acme Model Blogs Making model Acme Model Blogs Will write to SYSTEM include Making model Acme Model Blogs Will write to Users pmjones Sites blog demo include Using table blogs Not using inheritance Making class directory done Writing model class done Writing record class done Writing collection class done Connecting to database for metadata connected Fetching table cols done Fetching index info no indexes found Writing metadata class done Creating locale directory done Saving locale file for en US done Note What happens here is that Solar looks at the class name passed to make model takes the part after the last underscore and uses that as the table name It then looks up that table in the database and creates files for the model definition record class collection class column and index setup information and locale strings Solar models are smart enough to

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

  • Solar Framework for PHP 5
    the basic application class and its support directories script solar make app Acme App Blog Making app Creating app directory Creating app Layout directory Creating app Locale directory Creating app Public directory Creating app View directory App class Acme App Blog extends Acme Controller Page Preparing to write to SYSTEM include Writing app class Writing locale file Making public symlinks for Acme App Blog Making public directory docroot public Acme

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

  • Solar Framework for PHP 5
    PHP code at the top of the class above the actionIndex method php protected action default index protected model public list public item public form protected function setup parent setup this model Solar Registry get model catalog Some brief explanation of the properties is in order The action default property defines the default action when none is specified in the URI The model property will hold a reference to the registered Solar Sql Model Catalog object The model catalog retains model class instances for common use by the whole Solar system The list property is the list of records found when browsing blog articles It will be an empty array when no records exist or an Acme Model Blogs Collection object when records are found The item property is a single record for reading editing or adding a blog article It will be a null when no record exists or an Acme Model Blogs Record object when one is found The form property is a Solar Form object for a blog article Solar Form objects are hints to the view on how to render a form The setup method uses the Solar Registry to lazy load a reference to the

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

  • Solar Framework for PHP 5
    cols where join group having order and limit In addition there are other keys related to model fetches such as page and paging to indicate which page number of results to retrieve and how many results per page The this list property is populated by a call to the blogs model In this case we fetch all records a collection that match our fetch parameters Note Public properties of the controller are automatically assigned to the view at render time You don t need to assign them yourself 1 8 2 The Index View Script By default Solar page controllers expect to render a view script named for the action being invoked As such we need to create a view called index php for the actionIndex method vim Blog View index php View Inheritance Page controller view scripts are inherited from their parent controllers Thus an index php view script from a parent controller will be used if no such view script exists for the current page controller Enter the following code to replace whatever else might be there php title this getTextRaw TITLE INDEX this head setTitle title h2 php echo this getText HEADING INDEX 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 read item id ACTION READ li php endforeach ul php endif Essentially this view takes the collection of records in this list and presents them as an unordered list with a link to read each one Public properties from the page controller become properties of the view object For example this list refers to the list property from the page controller The page controller creates a

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

  • Solar Framework for PHP 5
    code to the class php public function actionRead id null was an ID specified if id return this error ERR NO ID SPECIFIED fetch one blog article by ID this item this model blogs fetch id did the blog article exist if this item return this error ERR NO SUCH ITEM URIs and Method Params In Solar the URIs are always in the format controller action param1 param2 That is the controller name is always first the action name is second and parameters for that action come last The params in the path info are passed to the action as method params So the a URI blog read 1 would map to a PHP call of Acme App Blog actionRead 1 If the URI is only controller then the controller will use the default action as defined in action default 1 9 2 The Read View Script Create a view called read php for the actionRead method vim Blog View read php Enter the following code in the new read php view script php this head setTitle this item title h2 php echo this escape this item title h2 php echo this nl2p this item body Essentially this view takes

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



  •